# HG changeset patch # User Durham Goode # Date 1499816099 25200 # Node ID bdffbddfa7045ebf1dbef545e92a3fd8a24ddb1f # Parent 07c38eee3954de62ba9fdefe673bc88719411add 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. diff --git a/hgsubversion/svnexternals.py b/hgsubversion/svnexternals.py --- 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):