comparison mercurial/localrepo.py @ 12176:ecab10820983

subrepos: add function for iterating over ctx subrepos
author Martin Geisler <mg@lazybytes.net>
date Tue, 07 Sep 2010 16:34:07 +0200
parents c0a8f9dea0f6
children 3388ab21d768
comparison
equal deleted inserted replaced
12175:c0a8f9dea0f6 12176:ecab10820983
1159 removed = mf1.keys() 1159 removed = mf1.keys()
1160 1160
1161 r = modified, added, removed, deleted, unknown, ignored, clean 1161 r = modified, added, removed, deleted, unknown, ignored, clean
1162 1162
1163 if listsubrepos: 1163 if listsubrepos:
1164 # Create a (subpath, ctx) mapping where we prefer subpaths 1164 for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
1165 # from ctx1. The subpaths from ctx2 are important when the
1166 # .hgsub file has been modified (in ctx2) but not yet
1167 # committed (in ctx1).
1168 subpaths = dict.fromkeys(ctx2.substate, ctx2)
1169 subpaths.update(dict.fromkeys(ctx1.substate, ctx1))
1170 for subpath, ctx in subpaths.iteritems():
1171 sub = ctx.sub(subpath)
1172 if working: 1165 if working:
1173 rev2 = None 1166 rev2 = None
1174 else: 1167 else:
1175 rev2 = ctx2.substate[subpath][1] 1168 rev2 = ctx2.substate[subpath][1]
1176 try: 1169 try: