changeset 1515:106716ed2ed0

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.
author Durham Goode <durham@fb.com>
date Tue, 11 Jul 2017 16:37:57 -0700
parents bdffbddfa704
children fbc22592f4fa
files hgsubversion/svnexternals.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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