mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
codereview: handle upload of merge
LGTM=minux R=minux CC=golang-codereviews https://golang.org/cl/118690043
This commit is contained in:
parent
6ff5c317eb
commit
c1fcdb0e00
1 changed files with 15 additions and 3 deletions
|
|
@ -3478,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,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue