Mercurial > hg-stable
changeset 20994:40800668e019
largefiles: don't prompt when one side of merge was changed but didn't change
This can happen after backout or grafts or criss cross merges. We already do
the same (but slightly different) thing in manifestmerge and filemerge.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Mon, 07 Apr 2014 23:10:20 +0200 |
parents | a8db48e997b5 |
children | e995d104c87f |
files | hgext/largefiles/overrides.py tests/test-largefiles.t |
diffstat | 2 files changed, 85 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Mon Apr 07 15:37:27 2014 -0500 +++ b/hgext/largefiles/overrides.py Mon Apr 07 23:10:20 2014 +0200 @@ -420,16 +420,18 @@ if not lfutil.isstandin(orig): return origfn(repo, mynode, orig, fcd, fco, fca) - if not fco.cmp(fcd): # files identical? - return None - - if repo.ui.promptchoice( - _('largefile %s has a merge conflict\nancestor was %s\n' - 'keep (l)ocal %s or\ntake (o)ther %s?' - '$$ &Local $$ &Other') % - (lfutil.splitstandin(orig), - fca.data().strip(), fcd.data().strip(), fco.data().strip()), - 0) == 1: + ahash = fca.data().strip().lower() + dhash = fcd.data().strip().lower() + ohash = fco.data().strip().lower() + if (ohash != ahash and + ohash != dhash and + (dhash == ahash or + repo.ui.promptchoice( + _('largefile %s has a merge conflict\nancestor was %s\n' + 'keep (l)ocal %s or\ntake (o)ther %s?' + '$$ &Local $$ &Other') % + (lfutil.splitstandin(orig), ahash, dhash, ohash), + 0) == 1)): repo.wwrite(fcd.path(), fco.data(), fco.flags()) return 0
--- a/tests/test-largefiles.t Mon Apr 07 15:37:27 2014 -0500 +++ b/tests/test-largefiles.t Mon Apr 07 23:10:20 2014 +0200 @@ -2226,6 +2226,79 @@ 0 largefiles updated, 0 removed $ cd .. + +Merge conflicts: + + $ hg init merge + $ cd merge + $ echo 0 > f-different + $ echo 0 > f-same + $ echo 0 > f-unchanged-1 + $ echo 0 > f-unchanged-2 + $ hg add --large * + $ hg ci -m0 + Invoking status precommit hook + A f-different + A f-same + A f-unchanged-1 + A f-unchanged-2 + $ echo tmp1 > f-unchanged-1 + $ echo tmp1 > f-unchanged-2 + $ echo tmp1 > f-same + $ hg ci -m1 + Invoking status precommit hook + M f-same + M f-unchanged-1 + M f-unchanged-2 + $ echo 2 > f-different + $ echo 0 > f-unchanged-1 + $ echo 1 > f-unchanged-2 + $ echo 1 > f-same + $ hg ci -m2 + Invoking status precommit hook + M f-different + M f-same + M f-unchanged-1 + M f-unchanged-2 + $ hg up -qr0 + $ echo tmp2 > f-unchanged-1 + $ echo tmp2 > f-unchanged-2 + $ echo tmp2 > f-same + $ hg ci -m3 + Invoking status precommit hook + M f-same + M f-unchanged-1 + M f-unchanged-2 + created new head + $ echo 1 > f-different + $ echo 1 > f-unchanged-1 + $ echo 0 > f-unchanged-2 + $ echo 1 > f-same + $ hg ci -m4 + Invoking status precommit hook + M f-different + M f-same + M f-unchanged-1 + M f-unchanged-2 + $ hg merge + largefile f-different has a merge conflict + ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7 + keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or + take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l + 0 files updated, 4 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) + getting changed largefiles + 1 largefiles updated, 0 removed + $ cat f-different + 1 + $ cat f-same + 1 + $ cat f-unchanged-1 + 1 + $ cat f-unchanged-2 + 1 + $ cd .. + Check whether "largefiles" feature is supported only in repositories enabling largefiles extension.