From 059f93be8a6362e7f53bef0d96a2f3a1315ac25b Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 6 Aug 2014 12:10:00 -0700 Subject: [PATCH 1/4] A+C: Derek Parker (individual CLA) Generated by a+c. R=gobot CC=golang-codereviews https://golang.org/cl/125750043 --- AUTHORS | 1 + CONTRIBUTORS | 1 + 2 files changed, 2 insertions(+) diff --git a/AUTHORS b/AUTHORS index 110220f761..c97790c7fa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -122,6 +122,7 @@ David Thomas David Titarenco Dean Prichard Denis Brandolini +Derek Parker Devon H. O'Dell Dhiru Kholia Dimitri Tcaciuc diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 287d7ffc55..1053057b5a 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -187,6 +187,7 @@ David Thomas David Titarenco Dean Prichard Denis Brandolini +Derek Parker Devon H. O'Dell Dhiru Kholia Dimitri Tcaciuc From c0ccf6f314a1658e148d1aae4db5ac2be249fbe8 Mon Sep 17 00:00:00 2001 From: Derek Parker Date: Wed, 6 Aug 2014 12:11:37 -0700 Subject: [PATCH 2/4] debug/dwarf: fix Reader panic on DW_TAG_unspecified_type The linker currently produces the DWARF 3 DW_TAG_unspecified_type tag, however the Reader in debug/dwarf will panic whenever that tag is encountered. Fixes #8437. LGTM=rsc R=golang-codereviews, bradfitz, iant, rsc CC=golang-codereviews https://golang.org/cl/117280043 --- src/pkg/debug/dwarf/type.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pkg/debug/dwarf/type.go b/src/pkg/debug/dwarf/type.go index 7b5f1cf7b9..e59737b0a4 100644 --- a/src/pkg/debug/dwarf/type.go +++ b/src/pkg/debug/dwarf/type.go @@ -88,6 +88,11 @@ type AddrType struct { BasicType } +// A UnspecifiedType represents implicit, unknown, ambiguous or nonexistent type. +type UnspecifiedType struct { + BasicType +} + // qualifiers // A QualType represents a type that has the C/C++ "const", "restrict", or "volatile" qualifier. @@ -630,6 +635,15 @@ func (d *Data) readType(name string, r typeReader, off Offset, typeCache map[Off typeCache[off] = t t.Name, _ = e.Val(AttrName).(string) t.Type = typeOf(e) + + case TagUnspecifiedType: + // Unspecified type (DWARF v3 ยง5.2) + // Attributes: + // AttrName: name + t := new(UnspecifiedType) + typ = t + typeCache[off] = t + t.Name, _ = e.Val(AttrName).(string) } if err != nil { From 6ff5c317ebf30d5d6879a2b0cd0c5ce34b97f97d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 6 Aug 2014 15:15:45 -0400 Subject: [PATCH 3/4] codereview: preserve branch prefix in subject during hg mail LGTM=minux R=minux CC=golang-codereviews https://golang.org/cl/124800043 --- lib/codereview/codereview.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 38c0553005..1b45518890 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -307,14 +307,19 @@ class CL(object): dir = CodeReviewDir(ui, repo) os.unlink(dir + "/cl." + self.name) - def Subject(self): + def Subject(self, ui, repo): + branchPrefix = "" + branch = repo[None].branch() + if branch.startswith("dev."): + branchPrefix = "[" + branch + "] " + s = line1(self.desc) if len(s) > 60: s = s[0:55] + "..." if self.name != "new": s = "code review %s: %s" % (self.name, s) typecheck(s, str) - return s + return branchPrefix + s def Upload(self, ui, repo, send_mail=False, gofmt=True, gofmt_just_warn=False, creating=False, quiet=False): if not self.files and not creating: @@ -324,10 +329,6 @@ class CL(object): set_status("uploading CL metadata + diffs") os.chdir(repo.root) - branchPrefix = "" - branch = repo[None].branch() - if branch.startswith("dev."): - branchPrefix = "[" + branch + "] " form_fields = [ ("content_upload", "1"), ("reviewers", JoinComma(self.reviewer)), @@ -363,7 +364,8 @@ class CL(object): form_fields.append(("subject", "diff -r " + vcs.base_rev + " " + ui.expandpath("default"))) else: # First upload sets the subject for the CL itself. - form_fields.append(("subject", branchPrefix+self.Subject())) + form_fields.append(("subject", self.Subject(ui, repo))) + ctype, body = EncodeMultipartFormData(form_fields, uploaded_diff_file) response_body = MySend("/upload", body, content_type=ctype) patchset = None @@ -416,7 +418,7 @@ class CL(object): else: pmsg += "Please take another look.\n" typecheck(pmsg, str) - PostMessage(ui, self.name, pmsg, subject=self.Subject()) + PostMessage(ui, self.name, pmsg, subject=self.Subject(ui, repo)) self.mailed = True self.Flush(ui, repo) From c1fcdb0e00f9163bc3f60069182f231afb83523e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 6 Aug 2014 15:25:17 -0400 Subject: [PATCH 4/4] codereview: handle upload of merge LGTM=minux R=minux CC=golang-codereviews https://golang.org/cl/118690043 --- lib/codereview/codereview.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 1b45518890..a64401533c 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -3478,11 +3478,23 @@ class MercurialVCS(VersionControlSystem): if not err and mqparent != "": self.base_rev = mqparent else: - out = RunShell(["hg", "parents", "-q"], silent_ok=True).strip() + out = RunShell(["hg", "parents", "-q", "--template={node} {branch}"], silent_ok=True).strip() if not out: # No revisions; use 0 to mean a repository with nothing. - out = "0:0" - self.base_rev = out.split(':')[1].strip() + out = "0:0 default" + + # Find parent along current branch. + branch = repo[None].branch() + base = "" + for line in out.splitlines(): + fields = line.strip().split(' ') + if fields[1] == branch: + base = fields[0] + break + if base == "": + # Use the first parent + base = out.strip().split(' ')[0] + self.base_rev = base def _GetRelPath(self, filename): """Get relative path of a file according to the current directory,