--- a/mercurial/subrepo.py Mon May 18 12:27:15 2015 -0500
+++ b/mercurial/subrepo.py Mon May 18 12:31:41 2015 -0500
@@ -596,21 +596,14 @@
def _storeclean(self, path):
clean = True
itercache = self._calcstorehash(path)
- try:
- for filehash in self._readstorehashcache(path):
- if filehash != itercache.next():
- clean = False
- break
- except StopIteration:
+ for filehash in self._readstorehashcache(path):
+ if filehash != next(itercache, None):
+ clean = False
+ break
+ if clean:
+ # if not empty:
# the cached and current pull states have a different size
- clean = False
- if clean:
- try:
- itercache.next()
- # the cached and current pull states have a different size
- clean = False
- except StopIteration:
- pass
+ clean = next(itercache, None) is None
return clean
def _calcstorehash(self, remotepath):