Show More
@@ -279,6 +279,7 b' def _iprompt(repo, mynode, orig, fcd, fc' | |||||
279 | keep as the merged version.""" |
|
279 | keep as the merged version.""" | |
280 | ui = repo.ui |
|
280 | ui = repo.ui | |
281 | fd = fcd.path() |
|
281 | fd = fcd.path() | |
|
282 | uipathfn = scmutil.getuipathfn(repo) | |||
282 |
|
283 | |||
283 | # Avoid prompting during an in-memory merge since it doesn't support merge |
|
284 | # Avoid prompting during an in-memory merge since it doesn't support merge | |
284 | # conflicts. |
|
285 | # conflicts. | |
@@ -287,7 +288,7 b' def _iprompt(repo, mynode, orig, fcd, fc' | |||||
287 | 'support file conflicts') |
|
288 | 'support file conflicts') | |
288 |
|
289 | |||
289 | prompts = partextras(labels) |
|
290 | prompts = partextras(labels) | |
290 | prompts['fd'] = fd |
|
291 | prompts['fd'] = uipathfn(fd) | |
291 | try: |
|
292 | try: | |
292 | if fco.isabsent(): |
|
293 | if fco.isabsent(): | |
293 | index = ui.promptchoice( |
|
294 | index = ui.promptchoice( | |
@@ -394,13 +395,14 b' def _premerge(repo, fcd, fco, fca, toolc' | |||||
394 |
|
395 | |||
395 | def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf): |
|
396 | def _mergecheck(repo, mynode, orig, fcd, fco, fca, toolconf): | |
396 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
397 | tool, toolpath, binary, symlink, scriptfn = toolconf | |
|
398 | uipathfn = scmutil.getuipathfn(repo) | |||
397 | if symlink: |
|
399 | if symlink: | |
398 | repo.ui.warn(_('warning: internal %s cannot merge symlinks ' |
|
400 | repo.ui.warn(_('warning: internal %s cannot merge symlinks ' | |
399 | 'for %s\n') % (tool, fcd.path())) |
|
401 | 'for %s\n') % (tool, uipathfn(fcd.path()))) | |
400 | return False |
|
402 | return False | |
401 | if fcd.isabsent() or fco.isabsent(): |
|
403 | if fcd.isabsent() or fco.isabsent(): | |
402 | repo.ui.warn(_('warning: internal %s cannot merge change/delete ' |
|
404 | repo.ui.warn(_('warning: internal %s cannot merge change/delete ' | |
403 | 'conflict for %s\n') % (tool, fcd.path())) |
|
405 | 'conflict for %s\n') % (tool, uipathfn(fcd.path()))) | |
404 | return False |
|
406 | return False | |
405 | return True |
|
407 | return True | |
406 |
|
408 | |||
@@ -580,9 +582,10 b' def _describemerge(ui, repo, mynode, fcl' | |||||
580 |
|
582 | |||
581 | def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): |
|
583 | def _xmerge(repo, mynode, orig, fcd, fco, fca, toolconf, files, labels=None): | |
582 | tool, toolpath, binary, symlink, scriptfn = toolconf |
|
584 | tool, toolpath, binary, symlink, scriptfn = toolconf | |
|
585 | uipathfn = scmutil.getuipathfn(repo) | |||
583 | if fcd.isabsent() or fco.isabsent(): |
|
586 | if fcd.isabsent() or fco.isabsent(): | |
584 | repo.ui.warn(_('warning: %s cannot merge change/delete conflict ' |
|
587 | repo.ui.warn(_('warning: %s cannot merge change/delete conflict ' | |
585 | 'for %s\n') % (tool, fcd.path())) |
|
588 | 'for %s\n') % (tool, uipathfn(fcd.path()))) | |
586 | return False, 1, None |
|
589 | return False, 1, None | |
587 | unused, unused, unused, back = files |
|
590 | unused, unused, unused, back = files | |
588 | localpath = _workingpath(repo, fcd) |
|
591 | localpath = _workingpath(repo, fcd) | |
@@ -622,7 +625,7 b' def _xmerge(repo, mynode, orig, fcd, fco' | |||||
622 | lambda s: procutil.shellquote(util.localpath(s))) |
|
625 | lambda s: procutil.shellquote(util.localpath(s))) | |
623 | if _toolbool(ui, tool, "gui"): |
|
626 | if _toolbool(ui, tool, "gui"): | |
624 | repo.ui.status(_('running merge tool %s for file %s\n') % |
|
627 | repo.ui.status(_('running merge tool %s for file %s\n') % | |
625 | (tool, fcd.path())) |
|
628 | (tool, uipathfn(fcd.path()))) | |
626 | if scriptfn is None: |
|
629 | if scriptfn is None: | |
627 | cmd = toolpath + ' ' + args |
|
630 | cmd = toolpath + ' ' + args | |
628 | repo.ui.debug('launching merge tool: %s\n' % cmd) |
|
631 | repo.ui.debug('launching merge tool: %s\n' % cmd) | |
@@ -841,6 +844,8 b' def _filemerge(premerge, repo, wctx, myn' | |||||
841 |
|
844 | |||
842 | ui = repo.ui |
|
845 | ui = repo.ui | |
843 | fd = fcd.path() |
|
846 | fd = fcd.path() | |
|
847 | uipathfn = scmutil.getuipathfn(repo) | |||
|
848 | fduipath = uipathfn(fd) | |||
844 | binary = fcd.isbinary() or fco.isbinary() or fca.isbinary() |
|
849 | binary = fcd.isbinary() or fco.isbinary() or fca.isbinary() | |
845 | symlink = 'l' in fcd.flags() + fco.flags() |
|
850 | symlink = 'l' in fcd.flags() + fco.flags() | |
846 | changedelete = fcd.isabsent() or fco.isabsent() |
|
851 | changedelete = fcd.isabsent() or fco.isabsent() | |
@@ -864,8 +869,8 b' def _filemerge(premerge, repo, wctx, myn' | |||||
864 | raise error.Abort(_("invalid 'python:' syntax: %s") % toolpath) |
|
869 | raise error.Abort(_("invalid 'python:' syntax: %s") % toolpath) | |
865 | toolpath = script |
|
870 | toolpath = script | |
866 | ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n" |
|
871 | ui.debug("picked tool '%s' for %s (binary %s symlink %s changedelete %s)\n" | |
867 |
% (tool, fd, pycompat.bytestr(binary), |
|
872 | % (tool, fduipath, pycompat.bytestr(binary), | |
868 |
|
|
873 | pycompat.bytestr(symlink), pycompat.bytestr(changedelete))) | |
869 |
|
874 | |||
870 | if tool in internals: |
|
875 | if tool in internals: | |
871 | func = internals[tool] |
|
876 | func = internals[tool] | |
@@ -891,9 +896,10 b' def _filemerge(premerge, repo, wctx, myn' | |||||
891 |
|
896 | |||
892 | if premerge: |
|
897 | if premerge: | |
893 | if orig != fco.path(): |
|
898 | if orig != fco.path(): | |
894 |
ui.status(_("merging %s and %s to %s\n") % |
|
899 | ui.status(_("merging %s and %s to %s\n") % | |
|
900 | (uipathfn(orig), uipathfn(fco.path()), fduipath)) | |||
895 | else: |
|
901 | else: | |
896 | ui.status(_("merging %s\n") % fd) |
|
902 | ui.status(_("merging %s\n") % fduipath) | |
897 |
|
903 | |||
898 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) |
|
904 | ui.debug("my %s other %s ancestor %s\n" % (fcd, fco, fca)) | |
899 |
|
905 | |||
@@ -904,7 +910,7 b' def _filemerge(premerge, repo, wctx, myn' | |||||
904 | raise error.InMemoryMergeConflictsError('in-memory merge does ' |
|
910 | raise error.InMemoryMergeConflictsError('in-memory merge does ' | |
905 | 'not support merge ' |
|
911 | 'not support merge ' | |
906 | 'conflicts') |
|
912 | 'conflicts') | |
907 | ui.warn(onfailure % fd) |
|
913 | ui.warn(onfailure % fduipath) | |
908 | return True, 1, False |
|
914 | return True, 1, False | |
909 |
|
915 | |||
910 | back = _makebackup(repo, ui, wctx, fcd, premerge) |
|
916 | back = _makebackup(repo, ui, wctx, fcd, premerge) | |
@@ -957,7 +963,7 b' def _filemerge(premerge, repo, wctx, myn' | |||||
957 | raise error.InMemoryMergeConflictsError('in-memory merge ' |
|
963 | raise error.InMemoryMergeConflictsError('in-memory merge ' | |
958 | 'does not support ' |
|
964 | 'does not support ' | |
959 | 'merge conflicts') |
|
965 | 'merge conflicts') | |
960 | ui.warn(onfailure % fd) |
|
966 | ui.warn(onfailure % fduipath) | |
961 | _onfilemergefailure(ui) |
|
967 | _onfilemergefailure(ui) | |
962 |
|
968 | |||
963 | return True, r, deleted |
|
969 | return True, r, deleted | |
@@ -985,6 +991,7 b' def hasconflictmarkers(data):' | |||||
985 |
|
991 | |||
986 | def _check(repo, r, ui, tool, fcd, files): |
|
992 | def _check(repo, r, ui, tool, fcd, files): | |
987 | fd = fcd.path() |
|
993 | fd = fcd.path() | |
|
994 | uipathfn = scmutil.getuipathfn(repo) | |||
988 | unused, unused, unused, back = files |
|
995 | unused, unused, unused, back = files | |
989 |
|
996 | |||
990 | if not r and (_toolbool(ui, tool, "checkconflicts") or |
|
997 | if not r and (_toolbool(ui, tool, "checkconflicts") or | |
@@ -996,7 +1003,7 b' def _check(repo, r, ui, tool, fcd, files' | |||||
996 | if 'prompt' in _toollist(ui, tool, "check"): |
|
1003 | if 'prompt' in _toollist(ui, tool, "check"): | |
997 | checked = True |
|
1004 | checked = True | |
998 | if ui.promptchoice(_("was merge of '%s' successful (yn)?" |
|
1005 | if ui.promptchoice(_("was merge of '%s' successful (yn)?" | |
999 | "$$ &Yes $$ &No") % fd, 1): |
|
1006 | "$$ &Yes $$ &No") % uipathfn(fd), 1): | |
1000 | r = 1 |
|
1007 | r = 1 | |
1001 |
|
1008 | |||
1002 | if not r and not checked and (_toolbool(ui, tool, "checkchanged") or |
|
1009 | if not r and not checked and (_toolbool(ui, tool, "checkchanged") or | |
@@ -1005,7 +1012,7 b' def _check(repo, r, ui, tool, fcd, files' | |||||
1005 | if back is not None and not fcd.cmp(back): |
|
1012 | if back is not None and not fcd.cmp(back): | |
1006 | if ui.promptchoice(_(" output file %s appears unchanged\n" |
|
1013 | if ui.promptchoice(_(" output file %s appears unchanged\n" | |
1007 | "was merge successful (yn)?" |
|
1014 | "was merge successful (yn)?" | |
1008 | "$$ &Yes $$ &No") % fd, 1): |
|
1015 | "$$ &Yes $$ &No") % uipathfn(fd), 1): | |
1009 | r = 1 |
|
1016 | r = 1 | |
1010 |
|
1017 | |||
1011 | if back is not None and _toolbool(ui, tool, "fixeol"): |
|
1018 | if back is not None and _toolbool(ui, tool, "fixeol"): |
@@ -37,8 +37,9 b' but then local changes are added in the ' | |||||
37 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
37 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
38 | $ hg up -C 2 |
|
38 | $ hg up -C 2 | |
39 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
39 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
40 | $ hg merge |
|
40 | Abuse this test for also testing that merge respects ui.relative-paths | |
41 | merging testdir/subdir/a and testdir/a to testdir/subdir/a |
|
41 | $ hg --cwd testdir merge --config ui.relative-paths=yes | |
|
42 | merging subdir/a and a to subdir/a | |||
42 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
43 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
43 | (branch merge, don't forget to commit) |
|
44 | (branch merge, don't forget to commit) | |
44 | $ hg stat |
|
45 | $ hg stat |
General Comments 0
You need to be logged in to leave comments.
Login now