Mercurial > hg
changeset 3330:49966b5ab16f
fix traceback of extdiff after a merge
- files that comes from a different branch are marked as modified
but aren't present in the original manifest
- add a testcase for extdiff and for regular diff
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 11 Oct 2006 16:35:09 +0200 |
parents | a1aad25ccc3e |
children | f472cf9a71af |
files | hgext/extdiff.py tests/test-extdiff tests/test-extdiff.out tests/test-merge1 tests/test-merge1.out |
diffstat | 5 files changed, 54 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/extdiff.py Tue Oct 10 00:02:30 2006 +0200 +++ b/hgext/extdiff.py Wed Oct 11 16:35:09 2006 +0200 @@ -65,6 +65,9 @@ ui.write_err(_('making snapshot of %d files from rev %s\n') % (len(files), short(node))) for fn in files: + if not fn in mf: + # skipping new file after a merge ? + continue wfn = util.pconvert(fn) ui.note(' %s\n' % wfn) dest = os.path.join(base, wfn)
--- a/tests/test-extdiff Tue Oct 10 00:02:30 2006 +0200 +++ b/tests/test-extdiff Wed Oct 11 16:35:09 2006 +0200 @@ -26,4 +26,13 @@ echo b >> a hg ci -d '1 0' -mtest2 -hg falabala -r 0:1 || echo "diff-like tools yield a non-zero exit code" +hg falabala -r 0:1 + +# test diff during merge +hg update 0 +echo b >> b +hg add b +hg ci -m "new branch" -d '1 0' +hg update -C 1 +hg merge tip +hg falabala || echo "diff-like tools yield a non-zero exit code"
--- a/tests/test-extdiff.out Tue Oct 10 00:02:30 2006 +0200 +++ b/tests/test-extdiff.out Wed Oct 11 16:35:09 2006 +0200 @@ -29,4 +29,11 @@ making snapshot of 1 files from rev e27a2475d60a making snapshot of 1 files from rev 5e49ec8d3f05 diffing a.e27a2475d60a a.5e49ec8d3f05 +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +1 files updated, 0 files merged, 1 files removed, 0 files unresolved +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +(branch merge, don't forget to commit) +making snapshot of 1 files from rev 5e49ec8d3f05 +making snapshot of 1 files from working dir +diffing a.5e49ec8d3f05 a diff-like tools yield a non-zero exit code
--- a/tests/test-merge1 Tue Oct 10 00:02:30 2006 +0200 +++ b/tests/test-merge1 Wed Oct 11 16:35:09 2006 +0200 @@ -23,6 +23,8 @@ echo This is file b1 > b echo %% no merges expected env HGMERGE=../merge hg merge 1 +hg diff --nodates +hg status cd ..; /bin/rm -rf t mkdir t @@ -44,6 +46,8 @@ env HGMERGE=../merge hg merge 1 echo %% merge of b expected env HGMERGE=../merge hg merge -f 1 +hg diff --nodates +hg status cd ..; /bin/rm -rf t echo %% @@ -71,6 +75,8 @@ env HGMERGE=../merge hg merge 2 echo %% merge expected! env HGMERGE=../merge hg merge -f 2 +hg diff --nodates +hg status cd ..; /bin/rm -rf t mkdir t @@ -93,4 +99,6 @@ env HGMERGE=../merge hg merge 2 echo %% merge of b expected env HGMERGE=../merge hg merge -f 2 +hg diff --nodates +hg status cd ..; /bin/rm -rf t
--- a/tests/test-merge1.out Tue Oct 10 00:02:30 2006 +0200 +++ b/tests/test-merge1.out Wed Oct 11 16:35:09 2006 +0200 @@ -4,6 +4,12 @@ merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) +diff -r d9e5953b9dec b +--- /dev/null ++++ b/b +@@ -0,0 +1,1 @@ ++This is file b1 +M b 0 files updated, 0 files merged, 1 files removed, 0 files unresolved %% merge should fail abort: 'b' already exists in the working dir and differs from remote @@ -12,6 +18,12 @@ merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) +diff -r d9e5953b9dec b +--- /dev/null ++++ b/b +@@ -0,0 +1,1 @@ ++This is file b2 +M b %% 1 files updated, 0 files merged, 0 files removed, 0 files unresolved Contents of b should be "this is file b1" @@ -23,6 +35,13 @@ merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) +diff -r c1dd73cbf59f b +--- a/b ++++ b/b +@@ -1,1 +1,1 @@ This is file b1 +-This is file b1 ++This is file b22 +M b 1 files updated, 0 files merged, 0 files removed, 0 files unresolved %% merge of b should fail abort: outstanding uncommitted changes @@ -31,3 +50,10 @@ merging b 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (branch merge, don't forget to commit) +diff -r c1dd73cbf59f b +--- a/b ++++ b/b +@@ -1,1 +1,1 @@ This is file b1 +-This is file b1 ++This is file b33 +M b