Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 33364:bf2daeddd42b
subrepo: consider the parent repo dirty when a file is missing
This simply passes the 'missing' argument down from the context of the parent
repo, so the same rules apply. subrepo.bailifchanged() is hardcoded to care
about missing files, because cmdutil.bailifchanged() is too.
In the end, it looks like this addresses inconsistencies with 'archive',
'identify', blackbox logs, 'merge', and 'update --check'. I wasn't sure how to
implement this in git, so that's left for someone more familiar with it.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 09 Jul 2017 02:55:46 -0400 |
parents | 160efb559f67 |
children | 0407a51b9d8c |
comparison
equal
deleted
inserted
replaced
33363:3047167733dc | 33364:bf2daeddd42b |
---|---|
1507 | 1507 |
1508 def dirty(self, missing=False, merge=True, branch=True): | 1508 def dirty(self, missing=False, merge=True, branch=True): |
1509 "check whether a working directory is modified" | 1509 "check whether a working directory is modified" |
1510 # check subrepos first | 1510 # check subrepos first |
1511 for s in sorted(self.substate): | 1511 for s in sorted(self.substate): |
1512 if self.sub(s).dirty(): | 1512 if self.sub(s).dirty(missing=missing): |
1513 return True | 1513 return True |
1514 # check current working dir | 1514 # check current working dir |
1515 return ((merge and self.p2()) or | 1515 return ((merge and self.p2()) or |
1516 (branch and self.branch() != self.p1().branch()) or | 1516 (branch and self.branch() != self.p1().branch()) or |
1517 self.modified() or self.added() or self.removed() or | 1517 self.modified() or self.added() or self.removed() or |