##// END OF EJS Templates
style: use consistent variable names (*mod) with imports which would shadow
Benoit Boissinot -
r10651:5f091fc1 default
parent child Browse files
Show More
@@ -13,7 +13,7 b' import hg, util, revlog, bundlerepo, ext'
13 13 import patch, help, mdiff, url, encoding, templatekw
14 14 import archival, changegroup, cmdutil, sshserver, hbisect
15 15 from hgweb import server, hgweb_mod, hgwebdir_mod
16 import merge as merge_
16 import merge as mergemod
17 17 import minirst
18 18
19 19 # Commands start here, listed alphabetically
@@ -2596,7 +2596,7 b' def resolve(ui, repo, *pats, **opts):'
2596 2596 raise util.Abort(_('no files or directories specified; '
2597 2597 'use --all to remerge all files'))
2598 2598
2599 ms = merge_.mergestate(repo)
2599 ms = mergemod.mergestate(repo)
2600 2600 m = cmdutil.match(repo, pats, opts)
2601 2601
2602 2602 for f in ms:
@@ -3083,7 +3083,7 b' def summary(ui, repo, **opts):'
3083 3083 ui.status(m)
3084 3084
3085 3085 st = list(repo.status(unknown=True))[:6]
3086 ms = merge_.mergestate(repo)
3086 ms = mergemod.mergestate(repo)
3087 3087 st.append([f for f in ms if ms[f] == 'u'])
3088 3088 labels = [_('%d modified'), _('%d added'), _('%d removed'),
3089 3089 _('%d deleted'), _('%d unknown'), _('%d ignored'),
@@ -9,7 +9,7 b' from i18n import _'
9 9 import os, sys, atexit, signal, pdb, socket, errno, shlex, time
10 10 import util, commands, hg, fancyopts, extensions, hook, error
11 11 import cmdutil, encoding
12 import ui as _ui
12 import ui as uimod
13 13
14 14 def run():
15 15 "run the command in sys.argv"
@@ -18,7 +18,7 b' def run():'
18 18 def dispatch(args):
19 19 "run the command specified in args"
20 20 try:
21 u = _ui.ui()
21 u = uimod.ui()
22 22 if '--traceback' in args:
23 23 u.setconfig('ui', 'traceback', 'on')
24 24 except util.Abort, inst:
@@ -10,8 +10,8 b' from i18n import _'
10 10 from lock import release
11 11 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
12 12 import lock, util, extensions, error, encoding, node
13 import merge as _merge
14 import verify as _verify
13 import merge as mergemod
14 import verify as verifymod
15 15 import errno, os, shutil
16 16
17 17 def _local(path):
@@ -358,7 +358,7 b' def _showstats(repo, stats):'
358 358
359 359 def update(repo, node):
360 360 """update the working directory to node, merging linear changes"""
361 stats = _merge.update(repo, node, False, False, None)
361 stats = mergemod.update(repo, node, False, False, None)
362 362 _showstats(repo, stats)
363 363 if stats[3]:
364 364 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
@@ -369,14 +369,14 b' def update(repo, node):'
369 369
370 370 def clean(repo, node, show_stats=True):
371 371 """forcibly switch the working directory to node, clobbering changes"""
372 stats = _merge.update(repo, node, False, True, None)
372 stats = mergemod.update(repo, node, False, True, None)
373 373 if show_stats:
374 374 _showstats(repo, stats)
375 375 return stats[3] > 0
376 376
377 377 def merge(repo, node, force=None, remind=True):
378 378 """branch merge with node, resolving changes"""
379 stats = _merge.update(repo, node, True, force, False)
379 stats = mergemod.update(repo, node, True, force, False)
380 380 _showstats(repo, stats)
381 381 if stats[3]:
382 382 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
@@ -387,8 +387,8 b' def merge(repo, node, force=None, remind'
387 387
388 388 def revert(repo, node, choose):
389 389 """revert changes to revision in node without updating dirstate"""
390 return _merge.update(repo, node, False, True, choose)[3] > 0
390 return mergemod.update(repo, node, False, True, choose)[3] > 0
391 391
392 392 def verify(repo):
393 393 """verify the consistency of a repository"""
394 return _verify.verify(repo)
394 return verifymod.verify(repo)
@@ -11,9 +11,9 b' import repo, changegroup, subrepo'
11 11 import changelog, dirstate, filelog, manifest, context
12 12 import lock, transaction, store, encoding
13 13 import util, extensions, hook, error
14 import match as match_
15 import merge as merge_
16 import tags as tags_
14 import match as matchmod
15 import merge as mergemod
16 import tags as tagsmod
17 17 from lock import release
18 18 import weakref, stat, errno, os, time, inspect
19 19 propertycache = util.propertycache
@@ -207,7 +207,7 b' class localrepository(repo.repository):'
207 207 if '.hgtags' not in self.dirstate:
208 208 self.add(['.hgtags'])
209 209
210 m = match_.exact(self.root, '', ['.hgtags'])
210 m = matchmod.exact(self.root, '', ['.hgtags'])
211 211 tagnode = self.commit(message, user, date, extra=extra, match=m)
212 212
213 213 for name in names:
@@ -268,8 +268,8 b' class localrepository(repo.repository):'
268 268 alltags = {} # map tag name to (node, hist)
269 269 tagtypes = {}
270 270
271 tags_.findglobaltags(self.ui, self, alltags, tagtypes)
272 tags_.readlocaltags(self.ui, self, alltags, tagtypes)
271 tagsmod.findglobaltags(self.ui, self, alltags, tagtypes)
272 tagsmod.readlocaltags(self.ui, self, alltags, tagtypes)
273 273
274 274 # Build the return dicts. Have to re-encode tag names because
275 275 # the tags module always uses UTF-8 (in order not to lose info
@@ -503,7 +503,7 b' class localrepository(repo.repository):'
503 503 for pat, cmd in self.ui.configitems(filter):
504 504 if cmd == '!':
505 505 continue
506 mf = match_.match(self.root, '', [pat])
506 mf = matchmod.match(self.root, '', [pat])
507 507 fn = None
508 508 params = cmd
509 509 for name, filterfn in self._datafilters.iteritems():
@@ -767,7 +767,7 b' class localrepository(repo.repository):'
767 767 raise util.Abort('%s: %s' % (f, msg))
768 768
769 769 if not match:
770 match = match_.always(self.root, '')
770 match = matchmod.always(self.root, '')
771 771
772 772 if not force:
773 773 vdirs = []
@@ -824,7 +824,7 b' class localrepository(repo.repository):'
824 824 and self[None].branch() == self['.'].branch()):
825 825 return None
826 826
827 ms = merge_.mergestate(self)
827 ms = mergemod.mergestate(self)
828 828 for f in changes[0]:
829 829 if f in ms and ms[f] == 'u':
830 830 raise util.Abort(_("unresolved merge conflicts "
@@ -996,7 +996,7 b' class localrepository(repo.repository):'
996 996
997 997 working = ctx2.rev() is None
998 998 parentworking = working and ctx1 == self['.']
999 match = match or match_.always(self.root, self.getcwd())
999 match = match or matchmod.always(self.root, self.getcwd())
1000 1000 listignored, listclean, listunknown = ignored, clean, unknown
1001 1001
1002 1002 # load earliest manifest first for caching reasons
@@ -6,25 +6,25 b''
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 import os
9 import stat as _stat
9 import stat as statmod
10 10
11 11 posixfile = open
12 12
13 13 def _mode_to_kind(mode):
14 if _stat.S_ISREG(mode):
15 return _stat.S_IFREG
16 if _stat.S_ISDIR(mode):
17 return _stat.S_IFDIR
18 if _stat.S_ISLNK(mode):
19 return _stat.S_IFLNK
20 if _stat.S_ISBLK(mode):
21 return _stat.S_IFBLK
22 if _stat.S_ISCHR(mode):
23 return _stat.S_IFCHR
24 if _stat.S_ISFIFO(mode):
25 return _stat.S_IFIFO
26 if _stat.S_ISSOCK(mode):
27 return _stat.S_IFSOCK
14 if statmod.S_ISREG(mode):
15 return statmod.S_IFREG
16 if statmod.S_ISDIR(mode):
17 return statmod.S_IFDIR
18 if statmod.S_ISLNK(mode):
19 return statmod.S_IFLNK
20 if statmod.S_ISBLK(mode):
21 return statmod.S_IFBLK
22 if statmod.S_ISCHR(mode):
23 return statmod.S_IFCHR
24 if statmod.S_ISFIFO(mode):
25 return statmod.S_IFIFO
26 if statmod.S_ISSOCK(mode):
27 return statmod.S_IFSOCK
28 28 return mode
29 29
30 30 def listdir(path, stat=False, skip=None):
@@ -49,7 +49,7 b' def listdir(path, stat=False, skip=None)'
49 49 names.sort()
50 50 for fn in names:
51 51 st = os.lstat(prefix + fn)
52 if fn == skip and _stat.S_ISDIR(st.st_mode):
52 if fn == skip and statmod.S_ISDIR(st.st_mode):
53 53 return []
54 54 if stat:
55 55 result.append((fn, _mode_to_kind(st.st_mode), st))
General Comments 0
You need to be logged in to leave comments. Login now