changeset 5317:ef65d6ec114e

localrepo: fix undelete() on merge working directory (issue 746)
author Patrick Mezard <pmezard@gmail.com>
date Sun, 23 Sep 2007 14:40:44 +0200
parents 598dae804a5f
children c6682cdada2f
files mercurial/localrepo.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Sat Sep 22 18:52:26 2007 +0200
+++ b/mercurial/localrepo.py	Sun Sep 23 14:40:44 2007 +0200
@@ -1005,15 +1005,15 @@
                 self.dirstate.update([f], "r")
 
     def undelete(self, list, wlock=None):
-        p = self.dirstate.parents()[0]
-        mn = self.changelog.read(p)[0]
-        m = self.manifest.read(mn)
+        manifests = [self.manifest.read(self.changelog.read(p)[0])
+                     for p in self.dirstate.parents() if p != nullid]
         if not wlock:
             wlock = self.wlock()
         for f in list:
             if self.dirstate.state(f) not in  "r":
                 self.ui.warn("%s not removed!\n" % f)
             else:
+                m = f in manifests[0] and manifests[0] or manifests[1]
                 t = self.file(f).read(m[f])
                 self.wwrite(f, t, m.flags(f))
                 self.dirstate.update([f], "n")