# HG changeset patch # User Durham Goode # Date 1499816277 25200 # Node ID 106716ed2ed09a8370881ac5b992022213147836 # Parent bdffbddfa7045ebf1dbef545e92a3fd8a24ddb1f subrepo: add missing arg to dirty() Upstream Mercurial has added a new 'missing' argument to the dirty function. We need to add it as well. The default argument should mean this is backwards compatible with older Mercurials. I don't understand the subrepo or hgsubverison code 100%, so this patch is my best attempt at a fix. diff --git a/hgsubversion/svnexternals.py b/hgsubversion/svnexternals.py --- a/hgsubversion/svnexternals.py +++ b/hgsubversion/svnexternals.py @@ -493,7 +493,7 @@ class svnsubrepo(subrepo.svnsubrepo): state = (source, state[1]) return super(svnsubrepo, self).get(state, *args, **kwargs) - def dirty(self, ignoreupdate=False): + def dirty(self, ignoreupdate=False, missing=False): # You cannot compare anything with HEAD. Just accept it # can be anything. if hgutil.safehasattr(self, '_wcrevs'): @@ -502,10 +502,11 @@ class svnsubrepo(subrepo.svnsubrepo): wcrev = self._wcrev() wcrevs = (wcrev, wcrev) shouldcheck = ('HEAD' in wcrevs or self._state[1] == 'HEAD' or - self._state[1] in wcrevs or ignoreupdate) + self._state[1] in wcrevs or ignoreupdate or missing) if shouldcheck: - changes, extchanges, missing = self._wcchanged() - if not changes: + changes, extchanges, wcmissing = self._wcchanged() + changed = changes or (missing and wcmissing) + if not changed: return False return True