Skip to content
Snippets Groups Projects
Commit 7833b13b authored by Siddharth Agarwal's avatar Siddharth Agarwal
Browse files

filemerge: move precheck to before files are written out

This is much simpler, and also avoids unnecessary disk IO.
parent 8bfef573
No related branches found
No related tags found
No related merge requests found
......@@ -500,6 +500,12 @@
ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca))
if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
toolconf):
if onfailure:
ui.warn(onfailure % fd)
return 1
a = repo.wjoin(fd)
b = temp("base", fca)
c = temp("other", fco)
......@@ -507,9 +513,9 @@
util.copyfile(a, back)
files = (a, b, c, back)
r = 0
if precheck and not precheck(repo, mynode, orig, fcd, fco, fca,
toolconf):
r = 1
needcheck = False
markerstyle = ui.config('ui', 'mergemarkers', 'basic')
if not labels:
labels = _defaultconflictlabels
if markerstyle != 'basic':
labels = _formatlabels(repo, fcd, fco, fca, labels)
......@@ -515,13 +521,6 @@
if not r: # precheck passed
markerstyle = ui.config('ui', 'mergemarkers', 'basic')
if not labels:
labels = _defaultconflictlabels
if markerstyle != 'basic':
labels = _formatlabels(repo, fcd, fco, fca, labels)
needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf,
files, labels=labels)
needcheck, r = func(repo, mynode, orig, fcd, fco, fca, toolconf, files,
labels=labels)
if not needcheck:
if r:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment