remote-hg: match hg merge behavior
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
This commit is contained in:

committed by
Jeff King

parent
ff247d9e56
commit
6497a2bab5
@ -427,6 +427,14 @@ def parse_blob(parser):
|
|||||||
parser.next()
|
parser.next()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def get_merge_files(repo, p1, p2, files):
|
||||||
|
for e in repo[p1].files():
|
||||||
|
if e not in files:
|
||||||
|
if e not in repo[p1].manifest():
|
||||||
|
continue
|
||||||
|
f = { 'ctx' : repo[p1][e] }
|
||||||
|
files[e] = f
|
||||||
|
|
||||||
def parse_commit(parser):
|
def parse_commit(parser):
|
||||||
global marks, blob_marks, bmarks, parsed_refs
|
global marks, blob_marks, bmarks, parsed_refs
|
||||||
|
|
||||||
@ -470,6 +478,8 @@ def parse_commit(parser):
|
|||||||
of = files[f]
|
of = files[f]
|
||||||
if 'deleted' in of:
|
if 'deleted' in of:
|
||||||
raise IOError
|
raise IOError
|
||||||
|
if 'ctx' in of:
|
||||||
|
return of['ctx']
|
||||||
is_exec = of['mode'] == 'x'
|
is_exec = of['mode'] == 'x'
|
||||||
is_link = of['mode'] == 'l'
|
is_link = of['mode'] == 'l'
|
||||||
return context.memfilectx(f, of['data'], is_link, is_exec, None)
|
return context.memfilectx(f, of['data'], is_link, is_exec, None)
|
||||||
@ -492,6 +502,13 @@ def parse_commit(parser):
|
|||||||
else:
|
else:
|
||||||
p2 = '\0' * 20
|
p2 = '\0' * 20
|
||||||
|
|
||||||
|
#
|
||||||
|
# If files changed from any of the parents, hg wants to know, but in git if
|
||||||
|
# nothing changed from the first parent, nothing changed.
|
||||||
|
#
|
||||||
|
if merge_mark:
|
||||||
|
get_merge_files(repo, p1, p2, files)
|
||||||
|
|
||||||
ctx = context.memctx(repo, (p1, p2), data,
|
ctx = context.memctx(repo, (p1, p2), data,
|
||||||
files.keys(), getfilectx,
|
files.keys(), getfilectx,
|
||||||
user, (date, tz), extra)
|
user, (date, tz), extra)
|
||||||
|
Reference in New Issue
Block a user