context: return dirstate parents in workingctx.ancestors()
authorDurham Goode <durham@fb.com>
Thu, 18 Dec 2014 09:37:14 -0800
changeset 23616 11a160547d7f
parent 23615 7cfe58983bff
child 23620 3d4aa20b775d
context: return dirstate parents in workingctx.ancestors() workingctx.ancestors() was not returning the dirstate parents as part of the result set. The only place this function is used is for copy detection when committing a file, and that code already checks the parents manually, so this change has no affect at the moment. I found it while playing around with changing how copy detection works.
mercurial/context.py
--- a/mercurial/context.py	Wed Dec 17 17:26:12 2014 -0800
+++ b/mercurial/context.py	Thu Dec 18 09:37:14 2014 -0800
@@ -1165,6 +1165,8 @@
         return sorted(self._repo.dirstate.matches(match))
 
     def ancestors(self):
+        for p in self._parents:
+            yield p
         for a in self._repo.changelog.ancestors(
             [p.rev() for p in self._parents]):
             yield changectx(self._repo, a)