Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 18364:6252b4f1c4b4
subrepos: process subrepos in sorted order
Add sorted() in places found by testing with PYTHONHASHSEED=random and code
inspection.
An alternative to sprinkling sorted() all over would be to change substate to a
custom dict with sorted iterators...
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Wed, 12 Dec 2012 02:38:14 +0100 |
parents | 8802277c40ee |
children | 94317c2d53b8 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Tue Jan 15 02:59:12 2013 +0100 +++ b/mercurial/cmdutil.py Wed Dec 12 02:38:14 2012 +0100 @@ -85,7 +85,7 @@ if modified or added or removed or deleted: raise util.Abort(_("outstanding uncommitted changes")) ctx = repo[None] - for s in ctx.substate: + for s in sorted(ctx.substate): if ctx.sub(s).dirty(): raise util.Abort(_("uncommitted changes in subrepo %s") % s) @@ -1515,7 +1515,7 @@ if ui.verbose or not exact: ui.status(_('adding %s\n') % match.rel(join(f))) - for subpath in wctx.substate: + for subpath in sorted(wctx.substate): sub = wctx.sub(subpath) try: submatch = matchmod.narrowmatcher(subpath, match) @@ -1546,7 +1546,7 @@ if explicitonly: forget = [f for f in forget if match.exact(f)] - for subpath in wctx.substate: + for subpath in sorted(wctx.substate): sub = wctx.sub(subpath) try: submatch = matchmod.narrowmatcher(subpath, match) @@ -1857,7 +1857,7 @@ names[abs] = m.rel(abs), m.exact(abs) # get the list of subrepos that must be reverted - targetsubs = [s for s in ctx.substate if m(s)] + targetsubs = sorted(s for s in ctx.substate if m(s)) m = scmutil.matchfiles(repo, names) changes = repo.status(match=m)[:4] modified, added, removed, deleted = map(set, changes)