[PATCH 4 of 6] context: introduce changes function to get a list of files changed

Idan Kamara idankk86 at gmail.com
Tue Mar 6 10:44:27 CST 2012


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1331052186 -7200
# Node ID 2d6eb93415d09c26c3bdf94bf74b584acc6ebab6
# Parent  d432a8416495be0ed9ff2ad3dbcb6dce55ac8739
context: introduce changes function to get a list of files changed

Will be used to display the list of changed files in the editor
when amending.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -237,6 +237,12 @@
         return patch.diff(self._repo, ctx2.node(), self.node(),
                           match=match, opts=diffopts)
 
+    def changes(self, ctx2=None, ignored=False, clean=False, unknown=False):
+        """Returns a list of files that were changed between ctx2 and self"""
+        if ctx2 is None:
+            ctx2 = self.p1()
+        return self._repo.status(ctx2, self._node, ignored, clean, unknown)
+
     @propertycache
     def _dirs(self):
         dirs = set()


More information about the Mercurial-devel mailing list