changeset 1514:bdffbddfa704

subrepo: refactor dirty() to be cleaner A future patch will modify dirty() to match an upstream change. Let's first refactor it to be a bit cleaner so the next patch is readable. This patch should not change any logic.
author Durham Goode <durham@fb.com>
date Tue, 11 Jul 2017 16:34:59 -0700
parents 07c38eee3954
children 106716ed2ed0
files hgsubversion/svnexternals.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnexternals.py
+++ b/hgsubversion/svnexternals.py
@@ -501,10 +501,12 @@ class svnsubrepo(subrepo.svnsubrepo):
         else:
             wcrev = self._wcrev()
             wcrevs = (wcrev, wcrev)
-        if (('HEAD' in wcrevs or self._state[1] == 'HEAD' or
-            self._state[1] in wcrevs or ignoreupdate)
-            and not self._wcchanged()[0]):
-            return False
+        shouldcheck = ('HEAD' in wcrevs or self._state[1] == 'HEAD' or
+                       self._state[1] in wcrevs or ignoreupdate)
+        if shouldcheck:
+            changes, extchanges, missing = self._wcchanged()
+            if not changes:
+                return False
         return True
 
     def commit(self, text, user, date):