Show More
@@ -871,7 +871,7 def overridearchive(orig, repo, dest, no | |||||
871 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) |
|
871 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) | |
872 |
|
872 | |||
873 | if subrepos: |
|
873 | if subrepos: | |
874 | for subpath in ctx.substate: |
|
874 | for subpath in sorted(ctx.substate): | |
875 | sub = ctx.sub(subpath) |
|
875 | sub = ctx.sub(subpath) | |
876 | submatch = match_.narrowmatcher(subpath, matchfn) |
|
876 | submatch = match_.narrowmatcher(subpath, matchfn) | |
877 | sub.archive(repo.ui, archiver, prefix, submatch) |
|
877 | sub.archive(repo.ui, archiver, prefix, submatch) | |
@@ -918,7 +918,7 def hgsubrepoarchive(orig, repo, ui, arc | |||||
918 |
|
918 | |||
919 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) |
|
919 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) | |
920 |
|
920 | |||
921 | for subpath in ctx.substate: |
|
921 | for subpath in sorted(ctx.substate): | |
922 | sub = ctx.sub(subpath) |
|
922 | sub = ctx.sub(subpath) | |
923 | submatch = match_.narrowmatcher(subpath, match) |
|
923 | submatch = match_.narrowmatcher(subpath, match) | |
924 | sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/', |
|
924 | sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/', |
@@ -947,7 +947,7 class queue(object): | |||||
947 | bctx = repo[baserev] |
|
947 | bctx = repo[baserev] | |
948 | else: |
|
948 | else: | |
949 | bctx = wctx.parents()[0] |
|
949 | bctx = wctx.parents()[0] | |
950 | for s in wctx.substate: |
|
950 | for s in sorted(wctx.substate): | |
951 | if wctx.sub(s).dirty(True): |
|
951 | if wctx.sub(s).dirty(True): | |
952 | raise util.Abort( |
|
952 | raise util.Abort( | |
953 | _("uncommitted changes in subrepository %s") % s) |
|
953 | _("uncommitted changes in subrepository %s") % s) |
@@ -299,7 +299,7 def archive(repo, dest, node, kind, deco | |||||
299 | repo.ui.progress(_('archiving'), None) |
|
299 | repo.ui.progress(_('archiving'), None) | |
300 |
|
300 | |||
301 | if subrepos: |
|
301 | if subrepos: | |
302 | for subpath in ctx.substate: |
|
302 | for subpath in sorted(ctx.substate): | |
303 | sub = ctx.sub(subpath) |
|
303 | sub = ctx.sub(subpath) | |
304 | submatch = matchmod.narrowmatcher(subpath, matchfn) |
|
304 | submatch = matchmod.narrowmatcher(subpath, matchfn) | |
305 | sub.archive(repo.ui, archiver, prefix, submatch) |
|
305 | sub.archive(repo.ui, archiver, prefix, submatch) |
@@ -85,7 +85,7 def bailifchanged(repo): | |||||
85 | if modified or added or removed or deleted: |
|
85 | if modified or added or removed or deleted: | |
86 | raise util.Abort(_("outstanding uncommitted changes")) |
|
86 | raise util.Abort(_("outstanding uncommitted changes")) | |
87 | ctx = repo[None] |
|
87 | ctx = repo[None] | |
88 | for s in ctx.substate: |
|
88 | for s in sorted(ctx.substate): | |
89 | if ctx.sub(s).dirty(): |
|
89 | if ctx.sub(s).dirty(): | |
90 | raise util.Abort(_("uncommitted changes in subrepo %s") % s) |
|
90 | raise util.Abort(_("uncommitted changes in subrepo %s") % s) | |
91 |
|
91 | |||
@@ -1515,7 +1515,7 def add(ui, repo, match, dryrun, listsub | |||||
1515 | if ui.verbose or not exact: |
|
1515 | if ui.verbose or not exact: | |
1516 | ui.status(_('adding %s\n') % match.rel(join(f))) |
|
1516 | ui.status(_('adding %s\n') % match.rel(join(f))) | |
1517 |
|
1517 | |||
1518 | for subpath in wctx.substate: |
|
1518 | for subpath in sorted(wctx.substate): | |
1519 | sub = wctx.sub(subpath) |
|
1519 | sub = wctx.sub(subpath) | |
1520 | try: |
|
1520 | try: | |
1521 | submatch = matchmod.narrowmatcher(subpath, match) |
|
1521 | submatch = matchmod.narrowmatcher(subpath, match) | |
@@ -1546,7 +1546,7 def forget(ui, repo, match, prefix, expl | |||||
1546 | if explicitonly: |
|
1546 | if explicitonly: | |
1547 | forget = [f for f in forget if match.exact(f)] |
|
1547 | forget = [f for f in forget if match.exact(f)] | |
1548 |
|
1548 | |||
1549 | for subpath in wctx.substate: |
|
1549 | for subpath in sorted(wctx.substate): | |
1550 | sub = wctx.sub(subpath) |
|
1550 | sub = wctx.sub(subpath) | |
1551 | try: |
|
1551 | try: | |
1552 | submatch = matchmod.narrowmatcher(subpath, match) |
|
1552 | submatch = matchmod.narrowmatcher(subpath, match) | |
@@ -1857,7 +1857,7 def revert(ui, repo, ctx, parents, *pats | |||||
1857 | names[abs] = m.rel(abs), m.exact(abs) |
|
1857 | names[abs] = m.rel(abs), m.exact(abs) | |
1858 |
|
1858 | |||
1859 | # get the list of subrepos that must be reverted |
|
1859 | # get the list of subrepos that must be reverted | |
1860 |
targetsubs = |
|
1860 | targetsubs = sorted(s for s in ctx.substate if m(s)) | |
1861 | m = scmutil.matchfiles(repo, names) |
|
1861 | m = scmutil.matchfiles(repo, names) | |
1862 | changes = repo.status(match=m)[:4] |
|
1862 | changes = repo.status(match=m)[:4] | |
1863 | modified, added, removed, deleted = map(set, changes) |
|
1863 | modified, added, removed, deleted = map(set, changes) |
@@ -1035,13 +1035,13 class workingctx(changectx): | |||||
1035 | return self._parents[0].ancestor(c2) # punt on two parents for now |
|
1035 | return self._parents[0].ancestor(c2) # punt on two parents for now | |
1036 |
|
1036 | |||
1037 | def walk(self, match): |
|
1037 | def walk(self, match): | |
1038 |
return sorted(self._repo.dirstate.walk(match, self.substate |
|
1038 | return sorted(self._repo.dirstate.walk(match, sorted(self.substate), | |
1039 | True, False)) |
|
1039 | True, False)) | |
1040 |
|
1040 | |||
1041 | def dirty(self, missing=False, merge=True, branch=True): |
|
1041 | def dirty(self, missing=False, merge=True, branch=True): | |
1042 | "check whether a working directory is modified" |
|
1042 | "check whether a working directory is modified" | |
1043 | # check subrepos first |
|
1043 | # check subrepos first | |
1044 | for s in self.substate: |
|
1044 | for s in sorted(self.substate): | |
1045 | if self.sub(s).dirty(): |
|
1045 | if self.sub(s).dirty(): | |
1046 | return True |
|
1046 | return True | |
1047 | # check current working dir |
|
1047 | # check current working dir |
@@ -373,7 +373,7 def subrepo(mctx, x): | |||||
373 | # i18n: "subrepo" is a keyword |
|
373 | # i18n: "subrepo" is a keyword | |
374 | getargs(x, 0, 1, _("subrepo takes at most one argument")) |
|
374 | getargs(x, 0, 1, _("subrepo takes at most one argument")) | |
375 | ctx = mctx.ctx |
|
375 | ctx = mctx.ctx | |
376 | sstate = ctx.substate |
|
376 | sstate = sorted(ctx.substate) | |
377 | if x: |
|
377 | if x: | |
378 | pat = getstring(x, _("subrepo requires a pattern or no arguments")) |
|
378 | pat = getstring(x, _("subrepo requires a pattern or no arguments")) | |
379 |
|
379 |
@@ -1500,7 +1500,7 class localrepository(object): | |||||
1500 | if working: # we need to scan the working dir |
|
1500 | if working: # we need to scan the working dir | |
1501 | subrepos = [] |
|
1501 | subrepos = [] | |
1502 | if '.hgsub' in self.dirstate: |
|
1502 | if '.hgsub' in self.dirstate: | |
1503 |
subrepos = ctx2.substate |
|
1503 | subrepos = sorted(ctx2.substate) | |
1504 | s = self.dirstate.status(match, subrepos, listignored, |
|
1504 | s = self.dirstate.status(match, subrepos, listignored, | |
1505 | listclean, listunknown) |
|
1505 | listclean, listunknown) | |
1506 | cmp, modified, added, removed, deleted, unknown, ignored, clean = s |
|
1506 | cmp, modified, added, removed, deleted, unknown, ignored, clean = s |
@@ -222,7 +222,7 def manifestmerge(repo, p1, p2, pa, over | |||||
222 |
|
222 | |||
223 | if '.hgsubstate' in m1: |
|
223 | if '.hgsubstate' in m1: | |
224 | # check whether sub state is modified |
|
224 | # check whether sub state is modified | |
225 | for s in p1.substate: |
|
225 | for s in sorted(p1.substate): | |
226 | if p1.sub(s).dirty(): |
|
226 | if p1.sub(s).dirty(): | |
227 | m1['.hgsubstate'] += "+" |
|
227 | m1['.hgsubstate'] += "+" | |
228 | break |
|
228 | break | |
@@ -593,7 +593,7 def update(repo, node, branchmerge, forc | |||||
593 | if not force and (wc.files() or wc.deleted()): |
|
593 | if not force and (wc.files() or wc.deleted()): | |
594 | raise util.Abort(_("outstanding uncommitted changes"), |
|
594 | raise util.Abort(_("outstanding uncommitted changes"), | |
595 | hint=_("use 'hg status' to list changes")) |
|
595 | hint=_("use 'hg status' to list changes")) | |
596 | for s in wc.substate: |
|
596 | for s in sorted(wc.substate): | |
597 | if wc.sub(s).dirty(): |
|
597 | if wc.sub(s).dirty(): | |
598 | raise util.Abort(_("outstanding uncommitted changes in " |
|
598 | raise util.Abort(_("outstanding uncommitted changes in " | |
599 | "subrepository '%s'") % s) |
|
599 | "subrepository '%s'") % s) |
@@ -147,7 +147,7 def submerge(repo, wctx, mctx, actx, ove | |||||
147 | r = "%s:%s:%s" % r |
|
147 | r = "%s:%s:%s" % r | |
148 | repo.ui.debug(" subrepo %s: %s %s\n" % (s, msg, r)) |
|
148 | repo.ui.debug(" subrepo %s: %s %s\n" % (s, msg, r)) | |
149 |
|
149 | |||
150 | for s, l in s1.items(): |
|
150 | for s, l in sorted(s1.iteritems()): | |
151 | a = sa.get(s, nullstate) |
|
151 | a = sa.get(s, nullstate) | |
152 | ld = l # local state with possible dirty flag for compares |
|
152 | ld = l # local state with possible dirty flag for compares | |
153 | if wctx.sub(s).dirty(): |
|
153 | if wctx.sub(s).dirty(): |
@@ -544,11 +544,11 Test archive | |||||
544 | archiving: .hgsubstate 2/2 files (100.00%) |
|
544 | archiving: .hgsubstate 2/2 files (100.00%) | |
545 | archiving (obstruct): 0/1 files (0.00%) |
|
545 | archiving (obstruct): 0/1 files (0.00%) | |
546 | archiving (obstruct): 1/1 files (100.00%) |
|
546 | archiving (obstruct): 1/1 files (100.00%) | |
|
547 | archiving (recreated): 0/1 files (0.00%) | |||
|
548 | archiving (recreated): 1/1 files (100.00%) | |||
547 | archiving (s): 0/2 files (0.00%) |
|
549 | archiving (s): 0/2 files (0.00%) | |
548 | archiving (s): 1/2 files (50.00%) |
|
550 | archiving (s): 1/2 files (50.00%) | |
549 | archiving (s): 2/2 files (100.00%) |
|
551 | archiving (s): 2/2 files (100.00%) | |
550 | archiving (recreated): 0/1 files (0.00%) |
|
|||
551 | archiving (recreated): 1/1 files (100.00%) |
|
|||
552 |
|
552 | |||
553 | $ hg archive -S ../archive-exclude --debug -X **old |
|
553 | $ hg archive -S ../archive-exclude --debug -X **old | |
554 | archiving: 0/2 files (0.00%) |
|
554 | archiving: 0/2 files (0.00%) | |
@@ -556,10 +556,10 Test archive | |||||
556 | archiving: .hgsubstate 2/2 files (100.00%) |
|
556 | archiving: .hgsubstate 2/2 files (100.00%) | |
557 | archiving (obstruct): 0/1 files (0.00%) |
|
557 | archiving (obstruct): 0/1 files (0.00%) | |
558 | archiving (obstruct): 1/1 files (100.00%) |
|
558 | archiving (obstruct): 1/1 files (100.00%) | |
|
559 | archiving (recreated): 0 files | |||
559 | archiving (s): 0/2 files (0.00%) |
|
560 | archiving (s): 0/2 files (0.00%) | |
560 | archiving (s): 1/2 files (50.00%) |
|
561 | archiving (s): 1/2 files (50.00%) | |
561 | archiving (s): 2/2 files (100.00%) |
|
562 | archiving (s): 2/2 files (100.00%) | |
562 | archiving (recreated): 0 files |
|
|||
563 | $ find ../archive-exclude | sort |
|
563 | $ find ../archive-exclude | sort | |
564 | ../archive-exclude |
|
564 | ../archive-exclude | |
565 | ../archive-exclude/.hg_archival.txt |
|
565 | ../archive-exclude/.hg_archival.txt |
General Comments 0
You need to be logged in to leave comments.
Login now