filemerge: use working dir parent as ancestor for backward wdir merge
I checked the tests, they were bogus in the first place
--- a/mercurial/filemerge.py Mon Apr 19 20:30:31 2010 +0200
+++ b/mercurial/filemerge.py Mon Apr 19 20:41:53 2010 +0200
@@ -135,6 +135,9 @@
if not fco.cmp(fcd.data()): # files identical?
return None
+ if fca == fco: # backwards, use working dir parent as ancestor
+ fca = fcd.parents()[0]
+
ui = repo.ui
fd = fcd.path()
binary = isbin(fcd) or isbin(fco) or isbin(fca)
--- a/tests/test-inotify Mon Apr 19 20:30:31 2010 +0200
+++ b/tests/test-inotify Mon Apr 19 20:41:53 2010 +0200
@@ -82,7 +82,7 @@
echo c >> a
hg st
-hg up 0
+HGMERGE=internal:local hg up 0
hg st
HGMERGE=internal:local hg up
--- a/tests/test-inotify.out Mon Apr 19 20:30:31 2010 +0200
+++ b/tests/test-inotify.out Mon Apr 19 20:41:53 2010 +0200
@@ -44,7 +44,6 @@
A h
R h/h
M a
-merging a
1 files updated, 1 files merged, 2 files removed, 0 files unresolved
M a
3 files updated, 1 files merged, 0 files removed, 0 files unresolved
--- a/tests/test-merge-local.out Mon Apr 19 20:30:31 2010 +0200
+++ b/tests/test-merge-local.out Mon Apr 19 20:41:53 2010 +0200
@@ -24,16 +24,20 @@
use 'hg resolve' to retry unresolved file merges
merging zzz1_merge_ok
merging zzz2_merge_bad
-2 files updated, 2 files merged, 3 files removed, 0 files unresolved
+warning: conflicts during merge.
+merging zzz2_merge_bad failed!
+2 files updated, 1 files merged, 3 files removed, 1 files unresolved
+use 'hg resolve' to retry unresolved file merges
--- a/zzz1_merge_ok
+++ b/zzz1_merge_ok
-+new first line
+new last line
--- a/zzz2_merge_bad
+++ b/zzz2_merge_bad
+another last line
++=======
M zzz1_merge_ok
M zzz2_merge_bad
+? zzz2_merge_bad.orig
# local merge with conflicts
merging zzz1_merge_ok
merging zzz2_merge_bad
@@ -43,18 +47,23 @@
use 'hg resolve' to retry unresolved file merges
merging zzz1_merge_ok
merging zzz2_merge_bad
-2 files updated, 2 files merged, 3 files removed, 0 files unresolved
+warning: conflicts during merge.
+merging zzz2_merge_bad failed!
+2 files updated, 1 files merged, 3 files removed, 1 files unresolved
+use 'hg resolve' to retry unresolved file merges
--- a/zzz1_merge_ok
+++ b/zzz1_merge_ok
-+new first line
+new last line
--- a/zzz2_merge_bad
+++ b/zzz2_merge_bad
+another last line
+=======
++=======
+new last line
++=======
M zzz1_merge_ok
M zzz2_merge_bad
+? zzz2_merge_bad.orig
# local merge without conflicts
merging zzz1_merge_ok
4 files updated, 1 files merged, 2 files removed, 0 files unresolved
--- a/tests/test-up-local-change.out Mon Apr 19 20:30:31 2010 +0200
+++ b/tests/test-up-local-change.out Mon Apr 19 20:41:53 2010 +0200
@@ -48,8 +48,7 @@
update: a 2/2 files (100.00%)
picked tool 'true' for a (binary False symlink False)
merging a
-my a@802f095af299+ other a@33aaa84a386b ancestor a@33aaa84a386b
- premerge successful
+my a@802f095af299+ other a@33aaa84a386b ancestor a@802f095af299
0 files updated, 1 files merged, 1 files removed, 0 files unresolved
changeset: 0:33aaa84a386b
user: test