[PATCH 1 of 3] subrepo: clarify comments in dirty() methods

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Jan 4 11:44:03 CST 2011


# HG changeset patch
# User Kevin Bullock <kbullock at ringworld.org>
# Date 1294159320 21600
# Node ID ac5b9beb9368870ecf2be251f50ac3c5655cc666
# Parent  f3058dd052819de75908599d93a29241ba69318f
subrepo: clarify comments in dirty() methods

Just a little change to bring the comments in the dirty() methods of the
various subrepo classes into a uniform structure. This clarifies the
meaning of the states checked.

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -398,8 +398,8 @@
         if r == '' and not ignoreupdate: # no state recorded
             return True
         w = self._repo[None]
-        # version checked out changed?
         if w.p1() != self._repo[r] and not ignoreupdate:
+            # different version checked out
             return True
         return w.dirty() # working directory changed
 
@@ -732,8 +732,8 @@
                                (revision, self._relpath))
 
     def dirty(self, ignoreupdate=False):
-        # version checked out changed?
         if not ignoreupdate and self._state[1] != self._gitstate():
+            # different version checked out
             return True
         # check for staged changes or modified files; ignore untracked files
         out, code = self._gitdir(['diff-index', '--quiet', 'HEAD'])


More information about the Mercurial-devel mailing list