# HG changeset patch # User Benoit Boissinot # Date 1144968110 -7200 # Node ID 2ff37e3bf7801829a49e4ef59d823c15b4abf969 # Parent 547ede0123a2ea5d3ef072b5b563306793b31fa0 fix update when a locally added file match the target revision the dirstate entry for the added file wasn't updated. fix issue207 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1573,8 +1573,9 @@ class localrepository(object): 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]: diff --git a/tests/test-up-local-change b/tests/test-up-local-change --- a/tests/test-up-local-change +++ b/tests/test-up-local-change @@ -55,3 +55,15 @@ hg --debug up -f -m 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 diff --git a/tests/test-up-local-change.out b/tests/test-up-local-change.out --- a/tests/test-up-local-change.out +++ b/tests/test-up-local-change.out @@ -136,3 +136,10 @@ diff -r 802f095af299 a @@ -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