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