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>
David Titarenco <david.titarenco@gmail.com>
Dean Prichard <dean.prichard@gmail.com>
Denis Brandolini <denis.brandolini@gmail.com>
Derek Parker <parkerderek86@gmail.com>
Devon H. O'Dell <devon.odell@gmail.com>
Dhiru Kholia <dhiru.kholia@gmail.com>
Dimitri Tcaciuc <dtcaciuc@gmail.com>
......
......@@ -187,6 +187,7 @@ David Thomas <davidthomas426@gmail.com>
David Titarenco <david.titarenco@gmail.com>
Dean Prichard <dean.prichard@gmail.com>
Denis Brandolini <denis.brandolini@gmail.com>
Derek Parker <parkerderek86@gmail.com>
Devon H. O'Dell <devon.odell@gmail.com>
Dhiru Kholia <dhiru.kholia@gmail.com>
Dimitri Tcaciuc <dtcaciuc@gmail.com>
......
......@@ -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,
......
......@@ -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 {
......
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