Commit 245ed93c authored by Russ Cox's avatar Russ Cox

all: merge default, for codereview fixes

LGTM=minux
R=minux
CC=golang-codereviews
https://golang.org/cl/124810043
parents bd69b447 c1fcdb0e
...@@ -122,6 +122,7 @@ David Thomas <davidthomas426@gmail.com> ...@@ -122,6 +122,7 @@ David Thomas <davidthomas426@gmail.com>
David Titarenco <david.titarenco@gmail.com> David Titarenco <david.titarenco@gmail.com>
Dean Prichard <dean.prichard@gmail.com> Dean Prichard <dean.prichard@gmail.com>
Denis Brandolini <denis.brandolini@gmail.com> Denis Brandolini <denis.brandolini@gmail.com>
Derek Parker <parkerderek86@gmail.com>
Devon H. O'Dell <devon.odell@gmail.com> Devon H. O'Dell <devon.odell@gmail.com>
Dhiru Kholia <dhiru.kholia@gmail.com> Dhiru Kholia <dhiru.kholia@gmail.com>
Dimitri Tcaciuc <dtcaciuc@gmail.com> Dimitri Tcaciuc <dtcaciuc@gmail.com>
......
...@@ -187,6 +187,7 @@ David Thomas <davidthomas426@gmail.com> ...@@ -187,6 +187,7 @@ David Thomas <davidthomas426@gmail.com>
David Titarenco <david.titarenco@gmail.com> David Titarenco <david.titarenco@gmail.com>
Dean Prichard <dean.prichard@gmail.com> Dean Prichard <dean.prichard@gmail.com>
Denis Brandolini <denis.brandolini@gmail.com> Denis Brandolini <denis.brandolini@gmail.com>
Derek Parker <parkerderek86@gmail.com>
Devon H. O'Dell <devon.odell@gmail.com> Devon H. O'Dell <devon.odell@gmail.com>
Dhiru Kholia <dhiru.kholia@gmail.com> Dhiru Kholia <dhiru.kholia@gmail.com>
Dimitri Tcaciuc <dtcaciuc@gmail.com> Dimitri Tcaciuc <dtcaciuc@gmail.com>
......
...@@ -307,14 +307,19 @@ class CL(object): ...@@ -307,14 +307,19 @@ class CL(object):
dir = CodeReviewDir(ui, repo) dir = CodeReviewDir(ui, repo)
os.unlink(dir + "/cl." + self.name) 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) s = line1(self.desc)
if len(s) > 60: if len(s) > 60:
s = s[0:55] + "..." s = s[0:55] + "..."
if self.name != "new": if self.name != "new":
s = "code review %s: %s" % (self.name, s) s = "code review %s: %s" % (self.name, s)
typecheck(s, str) 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): 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: if not self.files and not creating:
...@@ -324,10 +329,6 @@ class CL(object): ...@@ -324,10 +329,6 @@ class CL(object):
set_status("uploading CL metadata + diffs") set_status("uploading CL metadata + diffs")
os.chdir(repo.root) os.chdir(repo.root)
branchPrefix = ""
branch = repo[None].branch()
if branch.startswith("dev."):
branchPrefix = "[" + branch + "] "
form_fields = [ form_fields = [
("content_upload", "1"), ("content_upload", "1"),
("reviewers", JoinComma(self.reviewer)), ("reviewers", JoinComma(self.reviewer)),
...@@ -363,7 +364,8 @@ class CL(object): ...@@ -363,7 +364,8 @@ class CL(object):
form_fields.append(("subject", "diff -r " + vcs.base_rev + " " + ui.expandpath("default"))) form_fields.append(("subject", "diff -r " + vcs.base_rev + " " + ui.expandpath("default")))
else: else:
# First upload sets the subject for the CL itself. # 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) ctype, body = EncodeMultipartFormData(form_fields, uploaded_diff_file)
response_body = MySend("/upload", body, content_type=ctype) response_body = MySend("/upload", body, content_type=ctype)
patchset = None patchset = None
...@@ -416,7 +418,7 @@ class CL(object): ...@@ -416,7 +418,7 @@ class CL(object):
else: else:
pmsg += "Please take another look.\n" pmsg += "Please take another look.\n"
typecheck(pmsg, str) 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.mailed = True
self.Flush(ui, repo) self.Flush(ui, repo)
...@@ -3476,11 +3478,23 @@ class MercurialVCS(VersionControlSystem): ...@@ -3476,11 +3478,23 @@ class MercurialVCS(VersionControlSystem):
if not err and mqparent != "": if not err and mqparent != "":
self.base_rev = mqparent self.base_rev = mqparent
else: 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: if not out:
# No revisions; use 0 to mean a repository with nothing. # No revisions; use 0 to mean a repository with nothing.
out = "0:0" out = "0:0 default"
self.base_rev = out.split(':')[1].strip()
# 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): def _GetRelPath(self, filename):
"""Get relative path of a file according to the current directory, """Get relative path of a file according to the current directory,
......
...@@ -88,6 +88,11 @@ type AddrType struct { ...@@ -88,6 +88,11 @@ type AddrType struct {
BasicType BasicType
} }
// A UnspecifiedType represents implicit, unknown, ambiguous or nonexistent type.
type UnspecifiedType struct {
BasicType
}
// qualifiers // qualifiers
// A QualType represents a type that has the C/C++ "const", "restrict", or "volatile" qualifier. // 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 ...@@ -630,6 +635,15 @@ func (d *Data) readType(name string, r typeReader, off Offset, typeCache map[Off
typeCache[off] = t typeCache[off] = t
t.Name, _ = e.Val(AttrName).(string) t.Name, _ = e.Val(AttrName).(string)
t.Type = typeOf(e) 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 { if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment