fix update when a locally added file match the target revision
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 14 Apr 2006 00:41:50 +0200
changeset 2065 2ff37e3bf780
parent 2064 547ede0123a2
child 2070 4bce7e8bb42b
fix update when a locally added file match the target revision the dirstate entry for the added file wasn't updated. fix issue207
mercurial/localrepo.py
tests/test-up-local-change
tests/test-up-local-change.out
--- a/mercurial/localrepo.py	Thu Apr 13 13:46:56 2006 -0700
+++ b/mercurial/localrepo.py	Fri Apr 14 00:41:50 2006 +0200
@@ -1573,8 +1573,9 @@
                         self.ui.debug(_(" remote %s is newer, get\n") % f)
                         get[f] = m2[f]
                         s = 1
-                elif f in umap:
+                elif f in umap or f in added:
                     # this unknown file is the same as the checkout
+                    # we need to reset the dirstate if the file was added
                     get[f] = m2[f]
 
                 if not s and mfw[f] != mf2[f]:
--- a/tests/test-up-local-change	Thu Apr 13 13:46:56 2006 -0700
+++ b/tests/test-up-local-change	Fri Apr 14 00:41:50 2006 +0200
@@ -55,3 +55,15 @@
 hg parents
 hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
               -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
+
+# test a local add
+cd ..
+hg init a
+hg init b
+echo a > a/a
+echo a > b/a
+hg --cwd a commit -A -m a
+cd b
+hg add a 
+hg pull -u ../a
+hg st
--- a/tests/test-up-local-change.out	Thu Apr 13 13:46:56 2006 -0700
+++ b/tests/test-up-local-change.out	Fri Apr 14 00:41:50 2006 +0200
@@ -136,3 +136,10 @@
 @@ -1,1 +1,1 @@ a2
 -a2
 +abc
+adding a
+pulling from ../a
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files