Mercurial > hgsubversion
comparison hgsubversion/util.py @ 1558:ae572c9be4e6
cleanup: remove lots of dead imports and code found by pyflakes
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Sat, 24 Mar 2018 17:04:19 -0400 |
parents | cff81f35b31e |
children | d6b75cf2c27d |
comparison
equal
deleted
inserted
replaced
1557:dd409375c261 | 1558:ae572c9be4e6 |
---|---|
1 import compathacks | 1 import compathacks |
2 import errno | |
3 import re | 2 import re |
4 import os | 3 import os |
5 import urllib | 4 import urllib |
6 import json | 5 import json |
7 import gc | 6 import gc |
8 | 7 |
9 from mercurial import cmdutil | |
10 from mercurial import error | 8 from mercurial import error |
11 from mercurial import hg | 9 from mercurial import hg |
12 from mercurial import node | 10 from mercurial import node |
13 from mercurial import repair | 11 from mercurial import repair |
14 from mercurial import util as hgutil | 12 from mercurial import util as hgutil |
15 | 13 |
16 try: | 14 try: |
17 from collections import deque | |
18 except: | |
19 from mercurial.util import deque | |
20 | |
21 try: | |
22 from mercurial import revset | 15 from mercurial import revset |
23 except ImportError: | 16 except ImportError: |
24 pass | 17 pass |
25 | 18 |
26 try: | 19 try: |
27 from mercurial import smartset | 20 from mercurial import smartset |
28 smartset.baseset # force demandimport to load the module now | 21 smartset.baseset # force demandimport to load the module now |
29 except ImportError: | 22 except ImportError: |
30 smartset = None | 23 smartset = None |
31 | |
32 import maps | |
33 | 24 |
34 ignoredfiles = set(['.hgtags', '.hgsvnexternals', '.hgsub', '.hgsubstate']) | 25 ignoredfiles = set(['.hgtags', '.hgsvnexternals', '.hgsub', '.hgsubstate']) |
35 | 26 |
36 b_re = re.compile(r'^\+\+\+ b\/([^\n]*)', re.MULTILINE) | 27 b_re = re.compile(r'^\+\+\+ b\/([^\n]*)', re.MULTILINE) |
37 a_re = re.compile(r'^--- a\/([^\n]*)', re.MULTILINE) | 28 a_re = re.compile(r'^--- a\/([^\n]*)', re.MULTILINE) |
346 | 337 |
347 def revset_fromsvn(repo, subset, x): | 338 def revset_fromsvn(repo, subset, x): |
348 '''``fromsvn()`` | 339 '''``fromsvn()`` |
349 Select changesets that originate from Subversion. | 340 Select changesets that originate from Subversion. |
350 ''' | 341 ''' |
351 args = revset.getargs(x, 0, 0, "fromsvn takes no arguments") | 342 revset.getargs(x, 0, 0, "fromsvn takes no arguments") |
352 | 343 |
353 meta = repo.svnmeta(skiperrorcheck=True) | 344 meta = repo.svnmeta(skiperrorcheck=True) |
354 if not meta.revmapexists: | 345 if not meta.revmapexists: |
355 raise error.Abort("svn metadata is missing - " | 346 raise error.Abort("svn metadata is missing - " |
356 "run 'hg svn rebuildmeta' to reconstruct it") | 347 "run 'hg svn rebuildmeta' to reconstruct it") |