Mercurial > public > mercurial-scm > hg-stable
diff hgext/mq.py @ 10048:46de82e50790 stable
mq: qpop: remove added files before re-adding removed files
We need to do this to avoid file/directories conflicts.
This causes patches removing a committed file and replacing it
with a directory to be "unpoppable".
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Fri, 11 Dec 2009 15:09:52 +0900 |
parents | c51494c53841 |
children | 3e7663b2f3fc |
line wrap: on
line diff
--- a/hgext/mq.py Thu Dec 10 09:35:43 2009 -0500 +++ b/hgext/mq.py Fri Dec 11 15:09:52 2009 +0900 @@ -1096,12 +1096,6 @@ m, a, r, d = repo.status(qp, top)[:4] if d: raise util.Abort(_("deletions found between repo revs")) - for f in m: - getfile(f, mmap[f], mmap.flags(f)) - for f in r: - getfile(f, mmap[f], mmap.flags(f)) - for f in m + r: - repo.dirstate.normal(f) for f in a: try: os.unlink(repo.wjoin(f)) @@ -1111,6 +1105,12 @@ try: os.removedirs(os.path.dirname(repo.wjoin(f))) except: pass repo.dirstate.forget(f) + for f in m: + getfile(f, mmap[f], mmap.flags(f)) + for f in r: + getfile(f, mmap[f], mmap.flags(f)) + for f in m + r: + repo.dirstate.normal(f) repo.dirstate.setparents(qp, nullid) for patch in reversed(self.applied[start:end]): self.ui.status(_("popping %s\n") % patch.name)