Show More
@@ -213,7 +213,7 def list_stdlib_modules(): | |||||
213 | yield m |
|
213 | yield m | |
214 | for m in ['cffi']: |
|
214 | for m in ['cffi']: | |
215 | yield m |
|
215 | yield m | |
216 |
stdlib_prefixes = |
|
216 | stdlib_prefixes = {sys.prefix, sys.exec_prefix} | |
217 | # We need to supplement the list of prefixes for the search to work |
|
217 | # We need to supplement the list of prefixes for the search to work | |
218 | # when run from within a virtualenv. |
|
218 | # when run from within a virtualenv. | |
219 | for mod in (BaseHTTPServer, zlib): |
|
219 | for mod in (BaseHTTPServer, zlib): |
@@ -71,7 +71,7 testedwith = 'ships-with-hg-core' | |||||
71 | cmdtable = {} |
|
71 | cmdtable = {} | |
72 | command = cmdutil.command(cmdtable) |
|
72 | command = cmdutil.command(cmdtable) | |
73 |
|
73 | |||
74 |
newfile = |
|
74 | newfile = {'new fi', 'rename', 'copy f', 'copy t'} | |
75 |
|
75 | |||
76 | def zerodict(): |
|
76 | def zerodict(): | |
77 | return collections.defaultdict(lambda: 0) |
|
77 | return collections.defaultdict(lambda: 0) | |
@@ -336,7 +336,7 def synthesize(ui, repo, descpath, **opt | |||||
336 | wlock = repo.wlock() |
|
336 | wlock = repo.wlock() | |
337 | lock = repo.lock() |
|
337 | lock = repo.lock() | |
338 |
|
338 | |||
339 |
nevertouch = |
|
339 | nevertouch = {'.hgsub', '.hgignore', '.hgtags'} | |
340 |
|
340 | |||
341 | progress = ui.progress |
|
341 | progress = ui.progress | |
342 | _synthesizing = _('synthesizing') |
|
342 | _synthesizing = _('synthesizing') |
@@ -310,7 +310,7 class filemap_source(common.converter_so | |||||
310 | # map to any revision in the restricted graph. Put SKIPREV |
|
310 | # map to any revision in the restricted graph. Put SKIPREV | |
311 | # in the set of wanted ancestors to simplify code elsewhere |
|
311 | # in the set of wanted ancestors to simplify code elsewhere | |
312 | self.parentmap[rev] = SKIPREV |
|
312 | self.parentmap[rev] = SKIPREV | |
313 |
self.wantedancestors[rev] = |
|
313 | self.wantedancestors[rev] = {SKIPREV} | |
314 | return |
|
314 | return | |
315 |
|
315 | |||
316 | # Reuse the data from our parent. |
|
316 | # Reuse the data from our parent. |
@@ -32,7 +32,7 class submodule(object): | |||||
32 | return "%s %s" % (self.node, self.path) |
|
32 | return "%s %s" % (self.node, self.path) | |
33 |
|
33 | |||
34 | # Keys in extra fields that should not be copied if the user requests. |
|
34 | # Keys in extra fields that should not be copied if the user requests. | |
35 |
bannedextrakeys = |
|
35 | bannedextrakeys = { | |
36 | # Git commit object built-ins. |
|
36 | # Git commit object built-ins. | |
37 | 'tree', |
|
37 | 'tree', | |
38 | 'parent', |
|
38 | 'parent', | |
@@ -41,7 +41,7 bannedextrakeys = set([ | |||||
41 | # Mercurial built-ins. |
|
41 | # Mercurial built-ins. | |
42 | 'branch', |
|
42 | 'branch', | |
43 | 'close', |
|
43 | 'close', | |
44 | ]) |
|
44 | } | |
45 |
|
45 | |||
46 | class convert_git(common.converter_source, common.commandline): |
|
46 | class convert_git(common.converter_source, common.commandline): | |
47 | # Windows does not support GIT_DIR= construct while other systems |
|
47 | # Windows does not support GIT_DIR= construct while other systems | |
@@ -455,9 +455,9 class convert_git(common.converter_sourc | |||||
455 | ('refs/heads/', '') |
|
455 | ('refs/heads/', '') | |
456 | ] |
|
456 | ] | |
457 |
|
457 | |||
458 |
exclude = |
|
458 | exclude = { | |
459 | 'refs/remotes/origin/HEAD', |
|
459 | 'refs/remotes/origin/HEAD', | |
460 |
|
|
460 | } | |
461 |
|
461 | |||
462 | try: |
|
462 | try: | |
463 | output, status = self.gitrunlines('show-ref') |
|
463 | output, status = self.gitrunlines('show-ref') |
@@ -1641,8 +1641,8 def stripwrapper(orig, ui, repo, nodelis | |||||
1641 | if os.path.exists(os.path.join(repo.path, 'histedit-state')): |
|
1641 | if os.path.exists(os.path.join(repo.path, 'histedit-state')): | |
1642 | state = histeditstate(repo) |
|
1642 | state = histeditstate(repo) | |
1643 | state.read() |
|
1643 | state.read() | |
1644 |
histedit_nodes = |
|
1644 | histedit_nodes = {action.node for action | |
1645 |
|
|
1645 | in state.actions if action.node} | |
1646 | common_nodes = histedit_nodes & set(nodelist) |
|
1646 | common_nodes = histedit_nodes & set(nodelist) | |
1647 | if common_nodes: |
|
1647 | if common_nodes: | |
1648 | raise error.Abort(_("histedit in progress, can't strip %s") |
|
1648 | raise error.Abort(_("histedit in progress, can't strip %s") |
@@ -158,7 +158,7 def unsharejournal(orig, ui, repo, repop | |||||
158 | util.safehasattr(repo, 'journal')): |
|
158 | util.safehasattr(repo, 'journal')): | |
159 | sharedrepo = share._getsrcrepo(repo) |
|
159 | sharedrepo = share._getsrcrepo(repo) | |
160 | sharedfeatures = _readsharedfeatures(repo) |
|
160 | sharedfeatures = _readsharedfeatures(repo) | |
161 |
if sharedrepo and sharedfeatures > |
|
161 | if sharedrepo and sharedfeatures > {'journal'}: | |
162 | # there is a shared repository and there are shared journal entries |
|
162 | # there is a shared repository and there are shared journal entries | |
163 | # to copy. move shared date over from source to destination but |
|
163 | # to copy. move shared date over from source to destination but | |
164 | # move the local file first |
|
164 | # move the local file first |
@@ -129,7 +129,7 reposetup = reposetup.reposetup | |||||
129 |
|
129 | |||
130 | def featuresetup(ui, supported): |
|
130 | def featuresetup(ui, supported): | |
131 | # don't die on seeing a repo with the largefiles requirement |
|
131 | # don't die on seeing a repo with the largefiles requirement | |
132 |
supported |= |
|
132 | supported |= {'largefiles'} | |
133 |
|
133 | |||
134 | def uisetup(ui): |
|
134 | def uisetup(ui): | |
135 | localrepo.localrepository.featuresetupfuncs.add(featuresetup) |
|
135 | localrepo.localrepository.featuresetupfuncs.add(featuresetup) |
@@ -242,7 +242,7 class rebaseruntime(object): | |||||
242 | skipped = set() |
|
242 | skipped = set() | |
243 | # recompute the set of skipped revs |
|
243 | # recompute the set of skipped revs | |
244 | if not collapse: |
|
244 | if not collapse: | |
245 |
seen = |
|
245 | seen = {dest} | |
246 | for old, new in sorted(state.items()): |
|
246 | for old, new in sorted(state.items()): | |
247 | if new != revtodo and new in seen: |
|
247 | if new != revtodo and new in seen: | |
248 | skipped.add(old) |
|
248 | skipped.add(old) | |
@@ -250,7 +250,7 class rebaseruntime(object): | |||||
250 | repo.ui.debug('computed skipped revs: %s\n' % |
|
250 | repo.ui.debug('computed skipped revs: %s\n' % | |
251 | (' '.join(str(r) for r in sorted(skipped)) or None)) |
|
251 | (' '.join(str(r) for r in sorted(skipped)) or None)) | |
252 | repo.ui.debug('rebase status resumed\n') |
|
252 | repo.ui.debug('rebase status resumed\n') | |
253 |
_setrebasesetvisibility(repo, set(state.keys()) | |
|
253 | _setrebasesetvisibility(repo, set(state.keys()) | {originalwd}) | |
254 |
|
254 | |||
255 | self.originalwd = originalwd |
|
255 | self.originalwd = originalwd | |
256 | self.dest = dest |
|
256 | self.dest = dest | |
@@ -1235,7 +1235,7 def buildstate(repo, dest, rebaseset, co | |||||
1235 | rebaseset: set of rev |
|
1235 | rebaseset: set of rev | |
1236 | ''' |
|
1236 | ''' | |
1237 | originalwd = repo['.'].rev() |
|
1237 | originalwd = repo['.'].rev() | |
1238 |
_setrebasesetvisibility(repo, set(rebaseset) | |
|
1238 | _setrebasesetvisibility(repo, set(rebaseset) | {originalwd}) | |
1239 |
|
1239 | |||
1240 | # This check isn't strictly necessary, since mq detects commits over an |
|
1240 | # This check isn't strictly necessary, since mq detects commits over an | |
1241 | # applied patch. But it prevents messing up the working directory when |
|
1241 | # applied patch. But it prevents messing up the working directory when |
@@ -352,7 +352,7 def mutableancestors(ctx): | |||||
352 | """return all mutable ancestors for ctx (included) |
|
352 | """return all mutable ancestors for ctx (included) | |
353 |
|
353 | |||
354 | Much faster than the revset ancestors(ctx) & draft()""" |
|
354 | Much faster than the revset ancestors(ctx) & draft()""" | |
355 |
seen = |
|
355 | seen = {nodemod.nullrev} | |
356 | visit = collections.deque() |
|
356 | visit = collections.deque() | |
357 | visit.append(ctx) |
|
357 | visit.append(ctx) | |
358 | while visit: |
|
358 | while visit: | |
@@ -1006,17 +1006,17 def shelvecmd(ui, repo, *pats, **opts): | |||||
1006 | all shelved changes, use ``--cleanup``. |
|
1006 | all shelved changes, use ``--cleanup``. | |
1007 | ''' |
|
1007 | ''' | |
1008 | allowables = [ |
|
1008 | allowables = [ | |
1009 |
('addremove', |
|
1009 | ('addremove', {'create'}), # 'create' is pseudo action | |
1010 |
('unknown', |
|
1010 | ('unknown', {'create'}), | |
1011 |
('cleanup', |
|
1011 | ('cleanup', {'cleanup'}), | |
1012 |
# ('date', |
|
1012 | # ('date', {'create'}), # ignored for passing '--date "0 0"' in tests | |
1013 |
('delete', |
|
1013 | ('delete', {'delete'}), | |
1014 |
('edit', |
|
1014 | ('edit', {'create'}), | |
1015 |
('list', |
|
1015 | ('list', {'list'}), | |
1016 |
('message', |
|
1016 | ('message', {'create'}), | |
1017 |
('name', |
|
1017 | ('name', {'create'}), | |
1018 |
('patch', |
|
1018 | ('patch', {'patch', 'list'}), | |
1019 |
('stat', |
|
1019 | ('stat', {'stat', 'list'}), | |
1020 | ] |
|
1020 | ] | |
1021 | def checkopt(opt): |
|
1021 | def checkopt(opt): | |
1022 | if opts.get(opt): |
|
1022 | if opts.get(opt): |
@@ -185,7 +185,7 def underwayrevset(repo, subset, x): | |||||
185 | # Add working directory parent. |
|
185 | # Add working directory parent. | |
186 | wdirrev = repo['.'].rev() |
|
186 | wdirrev = repo['.'].rev() | |
187 | if wdirrev != nullrev: |
|
187 | if wdirrev != nullrev: | |
188 |
relevant += revset.baseset( |
|
188 | relevant += revset.baseset({wdirrev}) | |
189 |
|
189 | |||
190 | return subset & relevant |
|
190 | return subset & relevant | |
191 |
|
191 |
@@ -22,14 +22,14 modulepolicy = policy.policy | |||||
22 |
|
22 | |||
23 | # Modules that have both Python and C implementations. See also the |
|
23 | # Modules that have both Python and C implementations. See also the | |
24 | # set of .py files under mercurial/pure/. |
|
24 | # set of .py files under mercurial/pure/. | |
25 |
_dualmodules = |
|
25 | _dualmodules = { | |
26 | 'mercurial.base85', |
|
26 | 'mercurial.base85', | |
27 | 'mercurial.bdiff', |
|
27 | 'mercurial.bdiff', | |
28 | 'mercurial.diffhelpers', |
|
28 | 'mercurial.diffhelpers', | |
29 | 'mercurial.mpatch', |
|
29 | 'mercurial.mpatch', | |
30 | 'mercurial.osutil', |
|
30 | 'mercurial.osutil', | |
31 | 'mercurial.parsers', |
|
31 | 'mercurial.parsers', | |
32 | ]) |
|
32 | } | |
33 |
|
33 | |||
34 | class hgimporter(object): |
|
34 | class hgimporter(object): | |
35 | """Object that conforms to import hook interface defined in PEP-302.""" |
|
35 | """Object that conforms to import hook interface defined in PEP-302.""" |
@@ -47,7 +47,7 def commonancestorsheads(pfunc, *nodes): | |||||
47 | sv |= poison |
|
47 | sv |= poison | |
48 | if v in nodes: |
|
48 | if v in nodes: | |
49 | # history is linear |
|
49 | # history is linear | |
50 |
return |
|
50 | return {v} | |
51 | if sv < poison: |
|
51 | if sv < poison: | |
52 | for p in pfunc(v): |
|
52 | for p in pfunc(v): | |
53 | sp = seen[p] |
|
53 | sp = seen[p] | |
@@ -151,7 +151,7 class incrementalmissingancestors(object | |||||
151 |
|
151 | |||
152 | def hasbases(self): |
|
152 | def hasbases(self): | |
153 | '''whether the common set has any non-trivial bases''' |
|
153 | '''whether the common set has any non-trivial bases''' | |
154 |
return self.bases and self.bases != |
|
154 | return self.bases and self.bases != {nullrev} | |
155 |
|
155 | |||
156 | def addbases(self, newbases): |
|
156 | def addbases(self, newbases): | |
157 | '''grow the ancestor set by adding new bases''' |
|
157 | '''grow the ancestor set by adding new bases''' |
@@ -1693,7 +1693,7 def walkfilerevs(repo, match, follow, re | |||||
1693 | last = filelog.rev(node) |
|
1693 | last = filelog.rev(node) | |
1694 |
|
1694 | |||
1695 | # keep track of all ancestors of the file |
|
1695 | # keep track of all ancestors of the file | |
1696 |
ancestors = |
|
1696 | ancestors = {filelog.linkrev(last)} | |
1697 |
|
1697 | |||
1698 | # iterate from latest to oldest revision |
|
1698 | # iterate from latest to oldest revision | |
1699 | for rev, flparentlinkrevs, copied in filerevgen(filelog, last): |
|
1699 | for rev, flparentlinkrevs, copied in filerevgen(filelog, last): |
@@ -442,10 +442,10 if pycompat.osname == 'nt': | |||||
442 | 'inverse': _COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only |
|
442 | 'inverse': _COMMON_LVB_REVERSE_VIDEO, # double-byte charsets only | |
443 | } |
|
443 | } | |
444 |
|
444 | |||
445 |
passthrough = |
|
445 | passthrough = {_FOREGROUND_INTENSITY, | |
446 |
|
|
446 | _BACKGROUND_INTENSITY, | |
447 |
|
|
447 | _COMMON_LVB_UNDERSCORE, | |
448 |
|
|
448 | _COMMON_LVB_REVERSE_VIDEO} | |
449 |
|
449 | |||
450 | stdout = _kernel32.GetStdHandle( |
|
450 | stdout = _kernel32.GetStdHandle( | |
451 | _STD_OUTPUT_HANDLE) # don't close the handle returned |
|
451 | _STD_OUTPUT_HANDLE) # don't close the handle returned |
@@ -637,7 +637,7 def _checkcopies(ctx, f, m1, m2, base, t | |||||
637 | return |
|
637 | return | |
638 |
|
638 | |||
639 | of = None |
|
639 | of = None | |
640 |
seen = |
|
640 | seen = {f} | |
641 | for oc in getfctx(f, m1[f]).ancestors(): |
|
641 | for oc in getfctx(f, m1[f]).ancestors(): | |
642 | ocr = oc.linkrev() |
|
642 | ocr = oc.linkrev() | |
643 | of = oc.path() |
|
643 | of = oc.path() |
@@ -254,7 +254,7 def _oldheadssummary(repo, remoteheads, | |||||
254 | newheads = list(c.node() for c in r) |
|
254 | newheads = list(c.node() for c in r) | |
255 | # set some unsynced head to issue the "unsynced changes" warning |
|
255 | # set some unsynced head to issue the "unsynced changes" warning | |
256 | if inc: |
|
256 | if inc: | |
257 |
unsynced = |
|
257 | unsynced = {None} | |
258 | else: |
|
258 | else: | |
259 | unsynced = set() |
|
259 | unsynced = set() | |
260 | return {None: (oldheads, newheads, unsynced)} |
|
260 | return {None: (oldheads, newheads, unsynced)} |
@@ -749,7 +749,7 def _dispatch(req): | |||||
749 | # imported and commands.table is populated. |
|
749 | # imported and commands.table is populated. | |
750 | debugcommands.command |
|
750 | debugcommands.command | |
751 |
|
751 | |||
752 |
uis = |
|
752 | uis = {ui, lui} | |
753 |
|
753 | |||
754 | if req.repo: |
|
754 | if req.repo: | |
755 | uis.add(req.repo.ui) |
|
755 | uis.add(req.repo.ui) |
@@ -30,9 +30,9 if pycompat.ispy3: | |||||
30 | "206a 206b 206c 206d 206e 206f feff".split()] |
|
30 | "206a 206b 206c 206d 206e 206f feff".split()] | |
31 | # verify the next function will work |
|
31 | # verify the next function will work | |
32 | if pycompat.ispy3: |
|
32 | if pycompat.ispy3: | |
33 |
assert set(i[0] for i in _ignore) == |
|
33 | assert set(i[0] for i in _ignore) == {ord(b'\xe2'), ord(b'\xef')} | |
34 | else: |
|
34 | else: | |
35 |
assert set(i[0] for i in _ignore) == |
|
35 | assert set(i[0] for i in _ignore) == {"\xe2", "\xef"} | |
36 |
|
36 | |||
37 | def hfsignoreclean(s): |
|
37 | def hfsignoreclean(s): | |
38 | """Remove codepoints ignored by HFS+ from s. |
|
38 | """Remove codepoints ignored by HFS+ from s. |
@@ -43,7 +43,7 urlreq = util.urlreq | |||||
43 | } |
|
43 | } | |
44 |
|
44 | |||
45 | # Compression engines allowed in version 1. THIS SHOULD NEVER CHANGE. |
|
45 | # Compression engines allowed in version 1. THIS SHOULD NEVER CHANGE. | |
46 |
_bundlespecv1compengines = |
|
46 | _bundlespecv1compengines = {'gzip', 'bzip2', 'none'} | |
47 |
|
47 | |||
48 | def parsebundlespec(repo, spec, strict=True, externalnames=False): |
|
48 | def parsebundlespec(repo, spec, strict=True, externalnames=False): | |
49 | """Parse a bundle string specification into parts. |
|
49 | """Parse a bundle string specification into parts. | |
@@ -1522,7 +1522,7 def _pullobsolete(pullop): | |||||
1522 |
|
1522 | |||
1523 | def caps20to10(repo): |
|
1523 | def caps20to10(repo): | |
1524 | """return a set with appropriate options to use bundle20 during getbundle""" |
|
1524 | """return a set with appropriate options to use bundle20 during getbundle""" | |
1525 |
caps = |
|
1525 | caps = {'HG20'} | |
1526 | capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo)) |
|
1526 | capsblob = bundle2.encodecaps(bundle2.getrepocaps(repo)) | |
1527 | caps.add('bundle2=' + urlreq.quote(capsblob)) |
|
1527 | caps.add('bundle2=' + urlreq.quote(capsblob)) | |
1528 | return caps |
|
1528 | return caps |
@@ -28,8 +28,8 from . import ( | |||||
28 | _disabledextensions = {} |
|
28 | _disabledextensions = {} | |
29 | _aftercallbacks = {} |
|
29 | _aftercallbacks = {} | |
30 | _order = [] |
|
30 | _order = [] | |
31 |
_builtin = |
|
31 | _builtin = {'hbisect', 'bookmarks', 'parentrevspec', 'progress', 'interhg', | |
32 |
|
|
32 | 'inotify', 'hgcia'} | |
33 |
|
33 | |||
34 | def extensions(ui=None): |
|
34 | def extensions(ui=None): | |
35 | if ui: |
|
35 | if ui: |
@@ -14,7 +14,7 from . import ( | |||||
14 | ) |
|
14 | ) | |
15 |
|
15 | |||
16 | # Set of flags to not apply boolean negation logic on |
|
16 | # Set of flags to not apply boolean negation logic on | |
17 |
nevernegate = |
|
17 | nevernegate = { | |
18 | # avoid --no-noninteractive |
|
18 | # avoid --no-noninteractive | |
19 | 'noninteractive', |
|
19 | 'noninteractive', | |
20 | # These two flags are special because they cause hg to do one |
|
20 | # These two flags are special because they cause hg to do one | |
@@ -22,7 +22,7 nevernegate = set([ | |||||
22 | # like aliases anyway. |
|
22 | # like aliases anyway. | |
23 | 'help', |
|
23 | 'help', | |
24 | 'version', |
|
24 | 'version', | |
25 | ]) |
|
25 | } | |
26 |
|
26 | |||
27 | def gnugetopt(args, options, longoptions): |
|
27 | def gnugetopt(args, options, longoptions): | |
28 | """Parse options mostly like getopt.gnu_getopt. |
|
28 | """Parse options mostly like getopt.gnu_getopt. |
@@ -37,7 +37,7 elements = { | |||||
37 | "end": (0, None, None, None, None), |
|
37 | "end": (0, None, None, None, None), | |
38 | } |
|
38 | } | |
39 |
|
39 | |||
40 |
keywords = |
|
40 | keywords = {'and', 'or', 'not'} | |
41 |
|
41 | |||
42 | globchars = ".*{}[]?/\\_" |
|
42 | globchars = ".*{}[]?/\\_" | |
43 |
|
43 |
@@ -34,7 +34,7 from .hgweb import ( | |||||
34 | webcommands, |
|
34 | webcommands, | |
35 | ) |
|
35 | ) | |
36 |
|
36 | |||
37 |
_exclkeywords = |
|
37 | _exclkeywords = { | |
38 | "(ADVANCED)", |
|
38 | "(ADVANCED)", | |
39 | "(DEPRECATED)", |
|
39 | "(DEPRECATED)", | |
40 | "(EXPERIMENTAL)", |
|
40 | "(EXPERIMENTAL)", | |
@@ -44,7 +44,7 from .hgweb import ( | |||||
44 | _("(DEPRECATED)"), |
|
44 | _("(DEPRECATED)"), | |
45 | # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently |
|
45 | # i18n: "(EXPERIMENTAL)" is a keyword, must be translated consistently | |
46 | _("(EXPERIMENTAL)"), |
|
46 | _("(EXPERIMENTAL)"), | |
47 | ]) |
|
47 | } | |
48 |
|
48 | |||
49 | def listexts(header, exts, indent=1, showdeprecated=False): |
|
49 | def listexts(header, exts, indent=1, showdeprecated=False): | |
50 | '''return a text listing of the given extensions''' |
|
50 | '''return a text listing of the given extensions''' |
@@ -113,9 +113,9 def unfilteredmethod(orig): | |||||
113 | return orig(repo.unfiltered(), *args, **kwargs) |
|
113 | return orig(repo.unfiltered(), *args, **kwargs) | |
114 | return wrapper |
|
114 | return wrapper | |
115 |
|
115 | |||
116 |
moderncaps = |
|
116 | moderncaps = {'lookup', 'branchmap', 'pushkey', 'known', 'getbundle', | |
117 |
|
|
117 | 'unbundle'} | |
118 |
legacycaps = moderncaps.union( |
|
118 | legacycaps = moderncaps.union({'changegroupsubset'}) | |
119 |
|
119 | |||
120 | class localpeer(peer.peerrepository): |
|
120 | class localpeer(peer.peerrepository): | |
121 | '''peer for a local repo; reflects only the most recent API''' |
|
121 | '''peer for a local repo; reflects only the most recent API''' | |
@@ -247,11 +247,11 class locallegacypeer(localpeer): | |||||
247 |
|
247 | |||
248 | class localrepository(object): |
|
248 | class localrepository(object): | |
249 |
|
249 | |||
250 |
supportedformats = |
|
250 | supportedformats = {'revlogv1', 'generaldelta', 'treemanifest', | |
251 |
|
|
251 | 'manifestv2'} | |
252 |
_basesupported = supportedformats | |
|
252 | _basesupported = supportedformats | {'store', 'fncache', 'shared', | |
253 |
|
|
253 | 'relshared', 'dotencode'} | |
254 |
openerreqs = |
|
254 | openerreqs = {'revlogv1', 'generaldelta', 'treemanifest', 'manifestv2'} | |
255 | filtername = None |
|
255 | filtername = None | |
256 |
|
256 | |||
257 | # a list of (ui, featureset) functions. |
|
257 | # a list of (ui, featureset) functions. | |
@@ -2020,7 +2020,7 def newreporequirements(repo): | |||||
2020 | new repositories. |
|
2020 | new repositories. | |
2021 | """ |
|
2021 | """ | |
2022 | ui = repo.ui |
|
2022 | ui = repo.ui | |
2023 |
requirements = |
|
2023 | requirements = {'revlogv1'} | |
2024 | if ui.configbool('format', 'usestore', True): |
|
2024 | if ui.configbool('format', 'usestore', True): | |
2025 | requirements.add('store') |
|
2025 | requirements.add('store') | |
2026 | if ui.configbool('format', 'usefncache', True): |
|
2026 | if ui.configbool('format', 'usefncache', True): |
@@ -236,7 +236,7 class match(object): | |||||
236 |
|
236 | |||
237 | @propertycache |
|
237 | @propertycache | |
238 | def _dirs(self): |
|
238 | def _dirs(self): | |
239 |
return set(util.dirs(self._fileroots)) | |
|
239 | return set(util.dirs(self._fileroots)) | {'.'} | |
240 |
|
240 | |||
241 | def visitdir(self, dir): |
|
241 | def visitdir(self, dir): | |
242 | '''Decides whether a directory should be visited based on whether it |
|
242 | '''Decides whether a directory should be visited based on whether it |
@@ -46,7 +46,7 class namespaces(object): | |||||
46 | logfmt=_("tag: %s\n"), |
|
46 | logfmt=_("tag: %s\n"), | |
47 | listnames=tagnames, |
|
47 | listnames=tagnames, | |
48 | namemap=tagnamemap, nodemap=tagnodemap, |
|
48 | namemap=tagnamemap, nodemap=tagnodemap, | |
49 |
deprecated= |
|
49 | deprecated={'tip'}) | |
50 | self.addnamespace(n) |
|
50 | self.addnamespace(n) | |
51 |
|
51 | |||
52 | bnames = lambda repo: repo.branchmap().keys() |
|
52 | bnames = lambda repo: repo.branchmap().keys() |
@@ -23,7 +23,7 newnodeid = '!' * 20 | |||||
23 | addednodeid = ('0' * 15) + 'added' |
|
23 | addednodeid = ('0' * 15) + 'added' | |
24 | modifiednodeid = ('0' * 12) + 'modified' |
|
24 | modifiednodeid = ('0' * 12) + 'modified' | |
25 |
|
25 | |||
26 |
wdirnodes = |
|
26 | wdirnodes = {newnodeid, addednodeid, modifiednodeid} | |
27 |
|
27 | |||
28 | # pseudo identifiers for working directory |
|
28 | # pseudo identifiers for working directory | |
29 | # (they are experimental, so don't add too many dependencies on them) |
|
29 | # (they are experimental, so don't add too many dependencies on them) |
@@ -474,7 +474,7 def findexe(command): | |||||
474 | def setsignalhandler(): |
|
474 | def setsignalhandler(): | |
475 | pass |
|
475 | pass | |
476 |
|
476 | |||
477 |
_wantedkinds = |
|
477 | _wantedkinds = {stat.S_IFREG, stat.S_IFLNK} | |
478 |
|
478 | |||
479 | def statfiles(files): |
|
479 | def statfiles(files): | |
480 | '''Stat each file in files. Yield each stat, or None if a file does not |
|
480 | '''Stat each file in files. Yield each stat, or None if a file does not |
@@ -913,8 +913,8 class revlog(object): | |||||
913 | stop = [] |
|
913 | stop = [] | |
914 | stoprevs = set([self.rev(n) for n in stop]) |
|
914 | stoprevs = set([self.rev(n) for n in stop]) | |
915 | startrev = self.rev(start) |
|
915 | startrev = self.rev(start) | |
916 |
reachable = |
|
916 | reachable = {startrev} | |
917 |
heads = |
|
917 | heads = {startrev} | |
918 |
|
918 | |||
919 | parentrevs = self.parentrevs |
|
919 | parentrevs = self.parentrevs | |
920 | for r in self.revs(start=startrev + 1): |
|
920 | for r in self.revs(start=startrev + 1): | |
@@ -2039,7 +2039,7 class revlog(object): | |||||
2039 | DELTAREUSESAMEREVS = 'samerevs' |
|
2039 | DELTAREUSESAMEREVS = 'samerevs' | |
2040 | DELTAREUSENEVER = 'never' |
|
2040 | DELTAREUSENEVER = 'never' | |
2041 |
|
2041 | |||
2042 |
DELTAREUSEALL = |
|
2042 | DELTAREUSEALL = {'always', 'samerevs', 'never'} | |
2043 |
|
2043 | |||
2044 | def clone(self, tr, destrevlog, addrevisioncb=None, |
|
2044 | def clone(self, tr, destrevlog, addrevisioncb=None, | |
2045 | deltareuse=DELTAREUSESAMEREVS, aggressivemergedeltas=None): |
|
2045 | deltareuse=DELTAREUSESAMEREVS, aggressivemergedeltas=None): |
@@ -451,9 +451,8 def bookmark(repo, subset, x): | |||||
451 | for bmrev in matchrevs: |
|
451 | for bmrev in matchrevs: | |
452 | bms.add(repo[bmrev].rev()) |
|
452 | bms.add(repo[bmrev].rev()) | |
453 | else: |
|
453 | else: | |
454 | bms = set([repo[r].rev() |
|
454 | bms = {repo[r].rev() for r in repo._bookmarks.values()} | |
455 | for r in repo._bookmarks.values()]) |
|
455 | bms -= {node.nullrev} | |
456 | bms -= set([node.nullrev]) |
|
|||
457 | return subset & bms |
|
456 | return subset & bms | |
458 |
|
457 | |||
459 | @predicate('branch(string or set)', safe=True) |
|
458 | @predicate('branch(string or set)', safe=True) | |
@@ -1276,7 +1275,7 def named(repo, subset, x): | |||||
1276 | if name not in ns.deprecated: |
|
1275 | if name not in ns.deprecated: | |
1277 | names.update(repo[n].rev() for n in ns.nodes(repo, name)) |
|
1276 | names.update(repo[n].rev() for n in ns.nodes(repo, name)) | |
1278 |
|
1277 | |||
1279 |
names -= |
|
1278 | names -= {node.nullrev} | |
1280 | return subset & names |
|
1279 | return subset & names | |
1281 |
|
1280 | |||
1282 | @predicate('id(string)', safe=True) |
|
1281 | @predicate('id(string)', safe=True) | |
@@ -1363,8 +1362,8 def origin(repo, subset, x): | |||||
1363 | return src |
|
1362 | return src | |
1364 | src = prev |
|
1363 | src = prev | |
1365 |
|
1364 | |||
1366 |
o = |
|
1365 | o = {_firstsrc(r) for r in dests} | |
1367 |
o -= |
|
1366 | o -= {None} | |
1368 | # XXX we should turn this into a baseset instead of a set, smartset may do |
|
1367 | # XXX we should turn this into a baseset instead of a set, smartset may do | |
1369 | # some optimizations from the fact this is a baseset. |
|
1368 | # some optimizations from the fact this is a baseset. | |
1370 | return subset & o |
|
1369 | return subset & o | |
@@ -1393,7 +1392,7 def outgoing(repo, subset, x): | |||||
1393 | outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs) |
|
1392 | outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs) | |
1394 | repo.ui.popbuffer() |
|
1393 | repo.ui.popbuffer() | |
1395 | cl = repo.changelog |
|
1394 | cl = repo.changelog | |
1396 |
o = |
|
1395 | o = {cl.rev(r) for r in outgoing.missing} | |
1397 | return subset & o |
|
1396 | return subset & o | |
1398 |
|
1397 | |||
1399 | @predicate('p1([set])', safe=True) |
|
1398 | @predicate('p1([set])', safe=True) | |
@@ -1410,7 +1409,7 def p1(repo, subset, x): | |||||
1410 | cl = repo.changelog |
|
1409 | cl = repo.changelog | |
1411 | for r in getset(repo, fullreposet(repo), x): |
|
1410 | for r in getset(repo, fullreposet(repo), x): | |
1412 | ps.add(cl.parentrevs(r)[0]) |
|
1411 | ps.add(cl.parentrevs(r)[0]) | |
1413 |
ps -= |
|
1412 | ps -= {node.nullrev} | |
1414 | # XXX we should turn this into a baseset instead of a set, smartset may do |
|
1413 | # XXX we should turn this into a baseset instead of a set, smartset may do | |
1415 | # some optimizations from the fact this is a baseset. |
|
1414 | # some optimizations from the fact this is a baseset. | |
1416 | return subset & ps |
|
1415 | return subset & ps | |
@@ -1433,7 +1432,7 def p2(repo, subset, x): | |||||
1433 | cl = repo.changelog |
|
1432 | cl = repo.changelog | |
1434 | for r in getset(repo, fullreposet(repo), x): |
|
1433 | for r in getset(repo, fullreposet(repo), x): | |
1435 | ps.add(cl.parentrevs(r)[1]) |
|
1434 | ps.add(cl.parentrevs(r)[1]) | |
1436 |
ps -= |
|
1435 | ps -= {node.nullrev} | |
1437 | # XXX we should turn this into a baseset instead of a set, smartset may do |
|
1436 | # XXX we should turn this into a baseset instead of a set, smartset may do | |
1438 | # some optimizations from the fact this is a baseset. |
|
1437 | # some optimizations from the fact this is a baseset. | |
1439 | return subset & ps |
|
1438 | return subset & ps | |
@@ -1458,7 +1457,7 def parents(repo, subset, x): | |||||
1458 | up(p.rev() for p in repo[r].parents()) |
|
1457 | up(p.rev() for p in repo[r].parents()) | |
1459 | else: |
|
1458 | else: | |
1460 | up(parentrevs(r)) |
|
1459 | up(parentrevs(r)) | |
1461 |
ps -= |
|
1460 | ps -= {node.nullrev} | |
1462 | return subset & ps |
|
1461 | return subset & ps | |
1463 |
|
1462 | |||
1464 | def _phase(repo, subset, *targets): |
|
1463 | def _phase(repo, subset, *targets): | |
@@ -1965,7 +1964,7 def _toposort(revs, parentsfunc, firstbr | |||||
1965 | else: |
|
1964 | else: | |
1966 | # This is a new head. We create a new subgroup for it. |
|
1965 | # This is a new head. We create a new subgroup for it. | |
1967 | targetidx = len(groups) |
|
1966 | targetidx = len(groups) | |
1968 |
groups.append(([], |
|
1967 | groups.append(([], {rev})) | |
1969 |
|
1968 | |||
1970 | gr = groups[targetidx] |
|
1969 | gr = groups[targetidx] | |
1971 |
|
1970 | |||
@@ -2098,11 +2097,11 def tag(repo, subset, x): | |||||
2098 | if tn is None: |
|
2097 | if tn is None: | |
2099 | raise error.RepoLookupError(_("tag '%s' does not exist") |
|
2098 | raise error.RepoLookupError(_("tag '%s' does not exist") | |
2100 | % pattern) |
|
2099 | % pattern) | |
2101 |
s = |
|
2100 | s = {repo[tn].rev()} | |
2102 | else: |
|
2101 | else: | |
2103 |
s = |
|
2102 | s = {cl.rev(n) for t, n in repo.tagslist() if matcher(t)} | |
2104 | else: |
|
2103 | else: | |
2105 |
s = |
|
2104 | s = {cl.rev(n) for t, n in repo.tagslist() if t != 'tip'} | |
2106 | return subset & s |
|
2105 | return subset & s | |
2107 |
|
2106 | |||
2108 | @predicate('tagged', safe=True) |
|
2107 | @predicate('tagged', safe=True) |
@@ -44,9 +44,9 elements = { | |||||
44 | "end": (0, None, None, None, None), |
|
44 | "end": (0, None, None, None, None), | |
45 | } |
|
45 | } | |
46 |
|
46 | |||
47 |
keywords = |
|
47 | keywords = {'and', 'or', 'not'} | |
48 |
|
48 | |||
49 |
_quoteletters = |
|
49 | _quoteletters = {'"', "'"} | |
50 | _simpleopletters = set(pycompat.iterbytestr("():=,-|&+!~^%")) |
|
50 | _simpleopletters = set(pycompat.iterbytestr("():=,-|&+!~^%")) | |
51 |
|
51 | |||
52 | # default set of valid characters for the initial letter of symbols |
|
52 | # default set of valid characters for the initial letter of symbols |
@@ -123,7 +123,7 def _createhgwebservice(ui, repo, opts): | |||||
123 | if opts.get('port'): |
|
123 | if opts.get('port'): | |
124 | opts['port'] = util.getport(opts.get('port')) |
|
124 | opts['port'] = util.getport(opts.get('port')) | |
125 |
|
125 | |||
126 |
alluis = |
|
126 | alluis = {ui} | |
127 | if repo: |
|
127 | if repo: | |
128 | baseui = repo.baseui |
|
128 | baseui = repo.baseui | |
129 | alluis.update([repo.baseui, repo.ui]) |
|
129 | alluis.update([repo.baseui, repo.ui]) |
@@ -243,7 +243,7 def findcommonheads(ui, local, remote, | |||||
243 | raise error.Abort(_("repository is unrelated")) |
|
243 | raise error.Abort(_("repository is unrelated")) | |
244 | else: |
|
244 | else: | |
245 | ui.warn(_("warning: repository is unrelated\n")) |
|
245 | ui.warn(_("warning: repository is unrelated\n")) | |
246 |
return ( |
|
246 | return ({nullid}, True, srvheadhashes,) | |
247 |
|
247 | |||
248 | anyincoming = (srvheadhashes != [nullid]) |
|
248 | anyincoming = (srvheadhashes != [nullid]) | |
249 | return dag.externalizeall(result), anyincoming, srvheadhashes |
|
249 | return dag.externalizeall(result), anyincoming, srvheadhashes |
@@ -29,17 +29,17 from . import ( | |||||
29 | # modern/secure or legacy/insecure. Many operations in this module have |
|
29 | # modern/secure or legacy/insecure. Many operations in this module have | |
30 | # separate code paths depending on support in Python. |
|
30 | # separate code paths depending on support in Python. | |
31 |
|
31 | |||
32 |
configprotocols = |
|
32 | configprotocols = { | |
33 | 'tls1.0', |
|
33 | 'tls1.0', | |
34 | 'tls1.1', |
|
34 | 'tls1.1', | |
35 | 'tls1.2', |
|
35 | 'tls1.2', | |
36 | ]) |
|
36 | } | |
37 |
|
37 | |||
38 | hassni = getattr(ssl, 'HAS_SNI', False) |
|
38 | hassni = getattr(ssl, 'HAS_SNI', False) | |
39 |
|
39 | |||
40 | # TLS 1.1 and 1.2 may not be supported if the OpenSSL Python is compiled |
|
40 | # TLS 1.1 and 1.2 may not be supported if the OpenSSL Python is compiled | |
41 | # against doesn't support them. |
|
41 | # against doesn't support them. | |
42 |
supportedprotocols = |
|
42 | supportedprotocols = {'tls1.0'} | |
43 | if util.safehasattr(ssl, 'PROTOCOL_TLSv1_1'): |
|
43 | if util.safehasattr(ssl, 'PROTOCOL_TLSv1_1'): | |
44 | supportedprotocols.add('tls1.1') |
|
44 | supportedprotocols.add('tls1.1') | |
45 | if util.safehasattr(ssl, 'PROTOCOL_TLSv1_2'): |
|
45 | if util.safehasattr(ssl, 'PROTOCOL_TLSv1_2'): | |
@@ -296,7 +296,7 def protocolsettings(protocol): | |||||
296 | # disable protocols via SSLContext.options and OP_NO_* constants. |
|
296 | # disable protocols via SSLContext.options and OP_NO_* constants. | |
297 | # However, SSLContext.options doesn't work unless we have the |
|
297 | # However, SSLContext.options doesn't work unless we have the | |
298 | # full/real SSLContext available to us. |
|
298 | # full/real SSLContext available to us. | |
299 |
if supportedprotocols == |
|
299 | if supportedprotocols == {'tls1.0'}: | |
300 | if protocol != 'tls1.0': |
|
300 | if protocol != 'tls1.0': | |
301 | raise error.Abort(_('current Python does not support protocol ' |
|
301 | raise error.Abort(_('current Python does not support protocol ' | |
302 | 'setting %s') % protocol, |
|
302 | 'setting %s') % protocol, | |
@@ -430,7 +430,7 def wrapsocket(sock, keyfile, certfile, | |||||
430 | # is really old. (e.g. server doesn't support TLS 1.0+ or |
|
430 | # is really old. (e.g. server doesn't support TLS 1.0+ or | |
431 | # client doesn't support modern TLS versions introduced |
|
431 | # client doesn't support modern TLS versions introduced | |
432 | # several years from when this comment was written). |
|
432 | # several years from when this comment was written). | |
433 |
if supportedprotocols != |
|
433 | if supportedprotocols != {'tls1.0'}: | |
434 | ui.warn(_( |
|
434 | ui.warn(_( | |
435 | '(could not communicate with %s using security ' |
|
435 | '(could not communicate with %s using security ' | |
436 | 'protocols %s; if you are using a modern Mercurial ' |
|
436 | 'protocols %s; if you are using a modern Mercurial ' |
@@ -126,14 +126,14 contextmanager = contextlib.contextmanag | |||||
126 |
|
126 | |||
127 | __all__ = ['start', 'stop', 'reset', 'display', 'profile'] |
|
127 | __all__ = ['start', 'stop', 'reset', 'display', 'profile'] | |
128 |
|
128 | |||
129 |
skips = |
|
129 | skips = {"util.py:check", "extensions.py:closure", | |
130 |
|
|
130 | "color.py:colorcmd", "dispatch.py:checkargs", | |
131 |
|
|
131 | "dispatch.py:<lambda>", "dispatch.py:_runcatch", | |
132 |
|
|
132 | "dispatch.py:_dispatch", "dispatch.py:_runcommand", | |
133 |
|
|
133 | "pager.py:pagecmd", "dispatch.py:run", | |
134 |
|
|
134 | "dispatch.py:dispatch", "dispatch.py:runcommand", | |
135 |
|
|
135 | "hg.py:<module>", "evolve.py:warnobserrors", | |
136 | ]) |
|
136 | } | |
137 |
|
137 | |||
138 | ########################################################################### |
|
138 | ########################################################################### | |
139 | ## Utils |
|
139 | ## Utils |
@@ -26,10 +26,10 version = 2 | |||||
26 | # These are the file generators that should only be executed after the |
|
26 | # These are the file generators that should only be executed after the | |
27 | # finalizers are done, since they rely on the output of the finalizers (like |
|
27 | # finalizers are done, since they rely on the output of the finalizers (like | |
28 | # the changelog having been written). |
|
28 | # the changelog having been written). | |
29 |
postfinalizegenerators = |
|
29 | postfinalizegenerators = { | |
30 | 'bookmarks', |
|
30 | 'bookmarks', | |
31 | 'dirstate' |
|
31 | 'dirstate' | |
32 | ]) |
|
32 | } | |
33 |
|
33 | |||
34 | gengroupall='all' |
|
34 | gengroupall='all' | |
35 | gengroupprefinalize='prefinalize' |
|
35 | gengroupprefinalize='prefinalize' |
@@ -28,12 +28,12 def requiredsourcerequirements(repo): | |||||
28 | An upgrade will not be allowed if the repository doesn't have the |
|
28 | An upgrade will not be allowed if the repository doesn't have the | |
29 | requirements returned by this function. |
|
29 | requirements returned by this function. | |
30 | """ |
|
30 | """ | |
31 |
return |
|
31 | return { | |
32 | # Introduced in Mercurial 0.9.2. |
|
32 | # Introduced in Mercurial 0.9.2. | |
33 | 'revlogv1', |
|
33 | 'revlogv1', | |
34 | # Introduced in Mercurial 0.9.2. |
|
34 | # Introduced in Mercurial 0.9.2. | |
35 | 'store', |
|
35 | 'store', | |
36 |
|
|
36 | } | |
37 |
|
37 | |||
38 | def blocksourcerequirements(repo): |
|
38 | def blocksourcerequirements(repo): | |
39 | """Obtain requirements that will prevent an upgrade from occurring. |
|
39 | """Obtain requirements that will prevent an upgrade from occurring. | |
@@ -41,7 +41,7 def blocksourcerequirements(repo): | |||||
41 | An upgrade cannot be performed if the source repository contains a |
|
41 | An upgrade cannot be performed if the source repository contains a | |
42 | requirements in the returned set. |
|
42 | requirements in the returned set. | |
43 | """ |
|
43 | """ | |
44 |
return |
|
44 | return { | |
45 | # The upgrade code does not yet support these experimental features. |
|
45 | # The upgrade code does not yet support these experimental features. | |
46 | # This is an artificial limitation. |
|
46 | # This is an artificial limitation. | |
47 | 'manifestv2', |
|
47 | 'manifestv2', | |
@@ -51,7 +51,7 def blocksourcerequirements(repo): | |||||
51 | 'parentdelta', |
|
51 | 'parentdelta', | |
52 | # Upgrade should operate on the actual store, not the shared link. |
|
52 | # Upgrade should operate on the actual store, not the shared link. | |
53 | 'shared', |
|
53 | 'shared', | |
54 |
|
|
54 | } | |
55 |
|
55 | |||
56 | def supportremovedrequirements(repo): |
|
56 | def supportremovedrequirements(repo): | |
57 | """Obtain requirements that can be removed during an upgrade. |
|
57 | """Obtain requirements that can be removed during an upgrade. | |
@@ -70,13 +70,13 def supporteddestrequirements(repo): | |||||
70 |
|
70 | |||
71 | Extensions should monkeypatch this to add their custom requirements. |
|
71 | Extensions should monkeypatch this to add their custom requirements. | |
72 | """ |
|
72 | """ | |
73 |
return |
|
73 | return { | |
74 | 'dotencode', |
|
74 | 'dotencode', | |
75 | 'fncache', |
|
75 | 'fncache', | |
76 | 'generaldelta', |
|
76 | 'generaldelta', | |
77 | 'revlogv1', |
|
77 | 'revlogv1', | |
78 | 'store', |
|
78 | 'store', | |
79 |
|
|
79 | } | |
80 |
|
80 | |||
81 | def allowednewrequirements(repo): |
|
81 | def allowednewrequirements(repo): | |
82 | """Obtain requirements that can be added to a repository during upgrade. |
|
82 | """Obtain requirements that can be added to a repository during upgrade. | |
@@ -88,11 +88,11 def allowednewrequirements(repo): | |||||
88 | bad additions because the whitelist approach is safer and will prevent |
|
88 | bad additions because the whitelist approach is safer and will prevent | |
89 | future, unknown requirements from accidentally being added. |
|
89 | future, unknown requirements from accidentally being added. | |
90 | """ |
|
90 | """ | |
91 |
return |
|
91 | return { | |
92 | 'dotencode', |
|
92 | 'dotencode', | |
93 | 'fncache', |
|
93 | 'fncache', | |
94 | 'generaldelta', |
|
94 | 'generaldelta', | |
95 |
|
|
95 | } | |
96 |
|
96 | |||
97 | deficiency = 'deficiency' |
|
97 | deficiency = 'deficiency' | |
98 | optimisation = 'optimization' |
|
98 | optimisation = 'optimization' | |
@@ -628,7 +628,7 def _upgraderepo(ui, srcrepo, dstrepo, r | |||||
628 | ui.write(_('marking source repository as being upgraded; clients will be ' |
|
628 | ui.write(_('marking source repository as being upgraded; clients will be ' | |
629 | 'unable to read from repository\n')) |
|
629 | 'unable to read from repository\n')) | |
630 | scmutil.writerequires(srcrepo.vfs, |
|
630 | scmutil.writerequires(srcrepo.vfs, | |
631 |
srcrepo.requirements | |
|
631 | srcrepo.requirements | {'upgradeinprogress'}) | |
632 |
|
632 | |||
633 | ui.write(_('starting in-place swap of repository data\n')) |
|
633 | ui.write(_('starting in-place swap of repository data\n')) | |
634 | ui.write(_('replaced files will be backed up at %s\n') % |
|
634 | ui.write(_('replaced files will be backed up at %s\n') % |
@@ -1097,7 +1097,7 def checksignature(func): | |||||
1097 | return check |
|
1097 | return check | |
1098 |
|
1098 | |||
1099 | # a whilelist of known filesystems where hardlink works reliably |
|
1099 | # a whilelist of known filesystems where hardlink works reliably | |
1100 |
_hardlinkfswhitelist = |
|
1100 | _hardlinkfswhitelist = { | |
1101 | 'btrfs', |
|
1101 | 'btrfs', | |
1102 | 'ext2', |
|
1102 | 'ext2', | |
1103 | 'ext3', |
|
1103 | 'ext3', | |
@@ -1109,7 +1109,7 def checksignature(func): | |||||
1109 | 'ufs', |
|
1109 | 'ufs', | |
1110 | 'xfs', |
|
1110 | 'xfs', | |
1111 | 'zfs', |
|
1111 | 'zfs', | |
1112 | ]) |
|
1112 | } | |
1113 |
|
1113 | |||
1114 | def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False): |
|
1114 | def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False): | |
1115 | '''copy a file, preserving mode and optionally other stat info like |
|
1115 | '''copy a file, preserving mode and optionally other stat info like |
@@ -334,7 +334,7 def findexe(command): | |||||
334 | return executable |
|
334 | return executable | |
335 | return findexisting(os.path.expanduser(os.path.expandvars(command))) |
|
335 | return findexisting(os.path.expanduser(os.path.expandvars(command))) | |
336 |
|
336 | |||
337 |
_wantedkinds = |
|
337 | _wantedkinds = {stat.S_IFREG, stat.S_IFLNK} | |
338 |
|
338 | |||
339 | def statfiles(files): |
|
339 | def statfiles(files): | |
340 | '''Stat each file in files. Yield each stat, or None if a file |
|
340 | '''Stat each file in files. Yield each stat, or None if a file |
@@ -759,7 +759,7 def _capabilities(repo, proto): | |||||
759 | caps.append('stream-preferred') |
|
759 | caps.append('stream-preferred') | |
760 | requiredformats = repo.requirements & repo.supportedformats |
|
760 | requiredformats = repo.requirements & repo.supportedformats | |
761 | # if our local revlogs are just revlogv1, add 'stream' cap |
|
761 | # if our local revlogs are just revlogv1, add 'stream' cap | |
762 |
if not requiredformats - |
|
762 | if not requiredformats - {'revlogv1'}: | |
763 | caps.append('stream') |
|
763 | caps.append('stream') | |
764 | # otherwise, add 'streamreqs' detailing our local revlog format |
|
764 | # otherwise, add 'streamreqs' detailing our local revlog format | |
765 | else: |
|
765 | else: |
@@ -26,7 +26,7 def modulewhitelist(names): | |||||
26 | replacement = [('.py', ''), ('.c', ''), # trim suffix |
|
26 | replacement = [('.py', ''), ('.c', ''), # trim suffix | |
27 | ('mercurial%s' % (os.sep), ''), # trim "mercurial/" path |
|
27 | ('mercurial%s' % (os.sep), ''), # trim "mercurial/" path | |
28 | ] |
|
28 | ] | |
29 |
ignored = |
|
29 | ignored = {'__init__'} | |
30 | modules = {} |
|
30 | modules = {} | |
31 |
|
31 | |||
32 | # convert from file name to module name, and count # of appearances |
|
32 | # convert from file name to module name, and count # of appearances |
@@ -145,7 +145,7 def _parseasciigraph(text): | |||||
145 | def parents(y, x): |
|
145 | def parents(y, x): | |
146 | """(int, int) -> [str]. follow the ASCII edges at given position, |
|
146 | """(int, int) -> [str]. follow the ASCII edges at given position, | |
147 | return a list of parents""" |
|
147 | return a list of parents""" | |
148 |
visited = |
|
148 | visited = {(y, x)} | |
149 | visit = [] |
|
149 | visit = [] | |
150 | result = [] |
|
150 | result = [] | |
151 |
|
151 |
@@ -47,7 +47,7 def generatestates(maxchangesets, parent | |||||
47 | content in parentcontents]) + "-" + tracked |
|
47 | content in parentcontents]) + "-" + tracked | |
48 | yield (filename, parentcontents) |
|
48 | yield (filename, parentcontents) | |
49 | else: |
|
49 | else: | |
50 |
for content in ( |
|
50 | for content in ({None, 'content' + str(depth + 1)} | | |
51 | set(parentcontents)): |
|
51 | set(parentcontents)): | |
52 | for combination in generatestates(maxchangesets, |
|
52 | for combination in generatestates(maxchangesets, | |
53 | parentcontents + [content]): |
|
53 | parentcontents + [content]): |
@@ -49,7 +49,7 def buildgraph(rng, nodes=100, rootprob= | |||||
49 | def buildancestorsets(graph): |
|
49 | def buildancestorsets(graph): | |
50 | ancs = [None] * len(graph) |
|
50 | ancs = [None] * len(graph) | |
51 | for i in xrange(len(graph)): |
|
51 | for i in xrange(len(graph)): | |
52 |
ancs[i] = |
|
52 | ancs[i] = {i} | |
53 | if graph[i] == [nullrev]: |
|
53 | if graph[i] == [nullrev]: | |
54 | continue |
|
54 | continue | |
55 | for p in graph[i]: |
|
55 | for p in graph[i]: |
@@ -6,7 +6,7 from mercurial import ( | |||||
6 | ui as uimod, |
|
6 | ui as uimod, | |
7 | ) |
|
7 | ) | |
8 |
|
8 | |||
9 |
ignore = |
|
9 | ignore = {'highlight', 'win32text', 'factotum'} | |
10 |
|
10 | |||
11 | if os.name != 'nt': |
|
11 | if os.name != 'nt': | |
12 | ignore.add('win32mbcs') |
|
12 | ignore.add('win32mbcs') |
@@ -154,7 +154,7 check saving last-message.txt | |||||
154 | > from mercurial import util |
|
154 | > from mercurial import util | |
155 | > def abortfolding(ui, repo, hooktype, **kwargs): |
|
155 | > def abortfolding(ui, repo, hooktype, **kwargs): | |
156 | > ctx = repo[kwargs.get('node')] |
|
156 | > ctx = repo[kwargs.get('node')] | |
157 |
> if set(ctx.files()) == |
|
157 | > if set(ctx.files()) == {'c', 'd', 'f'}: | |
158 | > return True # abort folding commit only |
|
158 | > return True # abort folding commit only | |
159 | > ui.warn('allow non-folding commit\\n') |
|
159 | > ui.warn('allow non-folding commit\\n') | |
160 | > EOF |
|
160 | > EOF |
@@ -37,7 +37,7 another repository of push/pull/clone on | |||||
37 | > for name, module in extensions.extensions(ui): |
|
37 | > for name, module in extensions.extensions(ui): | |
38 | > if __name__ == module.__name__: |
|
38 | > if __name__ == module.__name__: | |
39 | > # support specific feature locally |
|
39 | > # support specific feature locally | |
40 |
> supported |= |
|
40 | > supported |= {'featuresetup-test'} | |
41 | > return |
|
41 | > return | |
42 | > def uisetup(ui): |
|
42 | > def uisetup(ui): | |
43 | > localrepo.localrepository.featuresetupfuncs.add(featuresetup) |
|
43 | > localrepo.localrepository.featuresetupfuncs.add(featuresetup) |
General Comments 0
You need to be logged in to leave comments.
Login now