Mercurial > hg
comparison mercurial/subrepo.py @ 13325:7ebdfa37842e
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.
author | Kevin Bullock <kbullock@ringworld.org> |
---|---|
date | Tue, 04 Jan 2011 10:42:00 -0600 |
parents | e5617047c926 |
children | 60792fa3c1a8 |
comparison
equal
deleted
inserted
replaced
13324:e5617047c926 | 13325:7ebdfa37842e |
---|---|
396 def dirty(self, ignoreupdate=False): | 396 def dirty(self, ignoreupdate=False): |
397 r = self._state[1] | 397 r = self._state[1] |
398 if r == '' and not ignoreupdate: # no state recorded | 398 if r == '' and not ignoreupdate: # no state recorded |
399 return True | 399 return True |
400 w = self._repo[None] | 400 w = self._repo[None] |
401 # version checked out changed? | |
402 if w.p1() != self._repo[r] and not ignoreupdate: | 401 if w.p1() != self._repo[r] and not ignoreupdate: |
402 # different version checked out | |
403 return True | 403 return True |
404 return w.dirty() # working directory changed | 404 return w.dirty() # working directory changed |
405 | 405 |
406 def checknested(self, path): | 406 def checknested(self, path): |
407 return self._repo._checknested(self._repo.wjoin(path)) | 407 return self._repo._checknested(self._repo.wjoin(path)) |
742 if not self._githavelocally(revision): | 742 if not self._githavelocally(revision): |
743 raise util.Abort(_("revision %s does not exist in subrepo %s\n") % | 743 raise util.Abort(_("revision %s does not exist in subrepo %s\n") % |
744 (revision, self._relpath)) | 744 (revision, self._relpath)) |
745 | 745 |
746 def dirty(self, ignoreupdate=False): | 746 def dirty(self, ignoreupdate=False): |
747 # version checked out changed? | |
748 if not ignoreupdate and self._state[1] != self._gitstate(): | 747 if not ignoreupdate and self._state[1] != self._gitstate(): |
748 # different version checked out | |
749 return True | 749 return True |
750 # check for staged changes or modified files; ignore untracked files | 750 # check for staged changes or modified files; ignore untracked files |
751 out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) | 751 out, code = self._gitdir(['diff-index', '--quiet', 'HEAD']) |
752 return code == 1 | 752 return code == 1 |
753 | 753 |