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 diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 38c0553005..a64401533c 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) @@ -3476,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, 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 {