comparison mercurial/scmutil.py @ 20392:d4f804caa0ed

itersubrepos: move to scmutil to break a direct import cycle
author Augie Fackler <raf@durin42.com>
date Mon, 03 Feb 2014 18:36:00 -0500
parents a6cf48b2880d
children 9ad6dae67845
comparison
equal deleted inserted replaced
20391:466e4c574db0 20392:d4f804caa0ed
17 else: 17 else:
18 import scmposix as scmplatform 18 import scmposix as scmplatform
19 19
20 systemrcpath = scmplatform.systemrcpath 20 systemrcpath = scmplatform.systemrcpath
21 userrcpath = scmplatform.userrcpath 21 userrcpath = scmplatform.userrcpath
22
23 def itersubrepos(ctx1, ctx2):
24 """find subrepos in ctx1 or ctx2"""
25 # Create a (subpath, ctx) mapping where we prefer subpaths from
26 # ctx1. The subpaths from ctx2 are important when the .hgsub file
27 # has been modified (in ctx2) but not yet committed (in ctx1).
28 subpaths = dict.fromkeys(ctx2.substate, ctx2)
29 subpaths.update(dict.fromkeys(ctx1.substate, ctx1))
30 for subpath, ctx in sorted(subpaths.iteritems()):
31 yield subpath, ctx.sub(subpath)
22 32
23 def nochangesfound(ui, repo, excluded=None): 33 def nochangesfound(ui, repo, excluded=None):
24 '''Report no changes for push/pull, excluded is None or a list of 34 '''Report no changes for push/pull, excluded is None or a list of
25 nodes excluded from the push/pull. 35 nodes excluded from the push/pull.
26 ''' 36 '''