Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 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 | dee573ba79f1 |
children | 46455285c6b5 |
comparison
equal
deleted
inserted
replaced
5316:598dae804a5f | 5317:ef65d6ec114e |
---|---|
1003 self.ui.warn(_("%s not tracked!\n") % f) | 1003 self.ui.warn(_("%s not tracked!\n") % f) |
1004 else: | 1004 else: |
1005 self.dirstate.update([f], "r") | 1005 self.dirstate.update([f], "r") |
1006 | 1006 |
1007 def undelete(self, list, wlock=None): | 1007 def undelete(self, list, wlock=None): |
1008 p = self.dirstate.parents()[0] | 1008 manifests = [self.manifest.read(self.changelog.read(p)[0]) |
1009 mn = self.changelog.read(p)[0] | 1009 for p in self.dirstate.parents() if p != nullid] |
1010 m = self.manifest.read(mn) | |
1011 if not wlock: | 1010 if not wlock: |
1012 wlock = self.wlock() | 1011 wlock = self.wlock() |
1013 for f in list: | 1012 for f in list: |
1014 if self.dirstate.state(f) not in "r": | 1013 if self.dirstate.state(f) not in "r": |
1015 self.ui.warn("%s not removed!\n" % f) | 1014 self.ui.warn("%s not removed!\n" % f) |
1016 else: | 1015 else: |
1016 m = f in manifests[0] and manifests[0] or manifests[1] | |
1017 t = self.file(f).read(m[f]) | 1017 t = self.file(f).read(m[f]) |
1018 self.wwrite(f, t, m.flags(f)) | 1018 self.wwrite(f, t, m.flags(f)) |
1019 self.dirstate.update([f], "n") | 1019 self.dirstate.update([f], "n") |
1020 | 1020 |
1021 def copy(self, source, dest, wlock=None): | 1021 def copy(self, source, dest, wlock=None): |