--- a/mercurial/context.py Mon Apr 23 12:09:54 2012 +0200
+++ b/mercurial/context.py Mon Apr 23 12:12:04 2012 +0200
@@ -940,14 +940,15 @@
return sorted(self._repo.dirstate.walk(match, self.substate.keys(),
True, False))
- def dirty(self, missing=False):
+ def dirty(self, missing=False, merge=True, branch=True):
"check whether a working directory is modified"
# check subrepos first
for s in self.substate:
if self.sub(s).dirty():
return True
# check current working dir
- return (self.p2() or self.branch() != self.p1().branch() or
+ return ((merge and self.p2()) or
+ (branch and self.branch() != self.p1().branch()) or
self.modified() or self.added() or self.removed() or
(missing and self.deleted()))