Commit 84b044e8 authored by Russ Cox's avatar Russ Cox

codereview: correct handling of files created with hg cp

R=r
CC=golang-dev
https://golang.org/cl/194118
parent 9f48f7e6
...@@ -2881,13 +2881,10 @@ class MercurialVCS(VersionControlSystem): ...@@ -2881,13 +2881,10 @@ class MercurialVCS(VersionControlSystem):
# the working copy # the working copy
if out[0].startswith('%s: ' % relpath): if out[0].startswith('%s: ' % relpath):
out = out[1:] out = out[1:]
if len(out) > 1: status, what = out[0].split(' ', 1)
# Moved/copied => considered as modified, use old filename to if len(out) > 1 and status == "A" and what == relpath:
# retrieve base contents
oldrelpath = out[1].strip() oldrelpath = out[1].strip()
status = "M" status = "M"
else:
status, _ = out[0].split(' ', 1)
if ":" in self.base_rev: if ":" in self.base_rev:
base_rev = self.base_rev.split(":", 1)[0] base_rev = self.base_rev.split(":", 1)[0]
else: else:
......
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