Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dirstate.py @ 7566:5f7e3f17aece
mq: drop copy records when refreshing regular patches (issue1441)
Copy information was saved in a common loop, then refined in a git-only block.
The problem was the latter did filter out renames occuring in the current
patch and irrelevant to commit. In the non-git case, copy records still existed
in the dirstate, referencing removed files, making the commit to fail. Git and
non-git copy handling paths are now separated for simplicity.
Reported by Gary Bernhardt
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 04 Jan 2009 21:32:40 +0100 |
parents | 810ca383da9c |
children | 127281884959 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Sun Jan 04 19:10:42 2009 +0100 +++ b/mercurial/dirstate.py Sun Jan 04 21:32:40 2009 +0100 @@ -216,10 +216,15 @@ self._dirty = False def copy(self, source, dest): + """Mark dest as a copy of source. Unmark dest if source is None. + """ if source == dest: return self._dirty = True - self._copymap[dest] = source + if source is not None: + self._copymap[dest] = source + elif dest in self._copymap: + del self._copymap[dest] def copied(self, file): return self._copymap.get(file, None)