##// END OF EJS Templates
resolve: perform all premerges before performing any file merges (BC)...
Siddharth Agarwal -
r26621:36383507 default
parent child Browse files
Show More
@@ -5568,6 +5568,7 b' def resolve(ui, repo, *pats, **opts):'
5568 ret = 0
5568 ret = 0
5569 didwork = False
5569 didwork = False
5570
5570
5571 tocomplete = []
5571 for f in ms:
5572 for f in ms:
5572 if not m(f):
5573 if not m(f):
5573 continue
5574 continue
@@ -5586,11 +5587,28 b' def resolve(ui, repo, *pats, **opts):'
5586 util.copyfile(a, a + ".resolve")
5587 util.copyfile(a, a + ".resolve")
5587
5588
5588 try:
5589 try:
5589 # resolve file
5590 # preresolve file
5590 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
5591 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
5591 'resolve')
5592 'resolve')
5592 complete, r = ms.preresolve(f, wctx)
5593 complete, r = ms.preresolve(f, wctx)
5593 if not complete:
5594 if not complete:
5595 tocomplete.append(f)
5596 elif r:
5597 ret = 1
5598 finally:
5599 ui.setconfig('ui', 'forcemerge', '', 'resolve')
5600 ms.commit()
5601
5602 # replace filemerge's .orig file with our resolve file
5603 # for files in tocomplete, ms.resolve will not overwrite
5604 # .orig -- only preresolve does
5605 util.rename(a + ".resolve", a + ".orig")
5606
5607 for f in tocomplete:
5608 try:
5609 # resolve file
5610 ui.setconfig('ui', 'forcemerge', opts.get('tool', ''),
5611 'resolve')
5594 r = ms.resolve(f, wctx)
5612 r = ms.resolve(f, wctx)
5595 if r:
5613 if r:
5596 ret = 1
5614 ret = 1
@@ -5598,9 +5616,6 b' def resolve(ui, repo, *pats, **opts):'
5598 ui.setconfig('ui', 'forcemerge', '', 'resolve')
5616 ui.setconfig('ui', 'forcemerge', '', 'resolve')
5599 ms.commit()
5617 ms.commit()
5600
5618
5601 # replace filemerge's .orig file with our resolve file
5602 util.rename(a + ".resolve", a + ".orig")
5603
5604 ms.commit()
5619 ms.commit()
5605
5620
5606 if not didwork and pats:
5621 if not didwork and pats:
@@ -135,8 +135,8 b' resolve without arguments should suggest'
135 resolve --all should re-merge all unresolved files
135 resolve --all should re-merge all unresolved files
136 $ hg resolve --all
136 $ hg resolve --all
137 merging file1
137 merging file1
138 merging file2
138 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
139 warning: conflicts while merging file1! (edit, then use 'hg resolve --mark')
139 merging file2
140 warning: conflicts while merging file2! (edit, then use 'hg resolve --mark')
140 warning: conflicts while merging file2! (edit, then use 'hg resolve --mark')
141 [1]
141 [1]
142 $ cat file1.orig
142 $ cat file1.orig
General Comments 0
You need to be logged in to leave comments. Login now