##// END OF EJS Templates
graphlog: import util module rather than selected functions
Dirkjan Ochtman -
r7713:b8c4ba0f default
parent child Browse files
Show More
@@ -17,9 +17,8 from mercurial.cmdutil import revrange,
17 from mercurial.commands import templateopts, logopts, remoteopts
17 from mercurial.commands import templateopts, logopts, remoteopts
18 from mercurial.i18n import _
18 from mercurial.i18n import _
19 from mercurial.node import nullrev
19 from mercurial.node import nullrev
20 from mercurial.util import Abort, canonpath
21 from mercurial import bundlerepo, changegroup, cmdutil, commands, extensions
20 from mercurial import bundlerepo, changegroup, cmdutil, commands, extensions
22 from mercurial import hg, ui, url
21 from mercurial import hg, ui, url, util
23
22
24 def revisions(repo, start, stop):
23 def revisions(repo, start, stop):
25 """cset DAG generator yielding (rev, node, [parents]) tuples
24 """cset DAG generator yielding (rev, node, [parents]) tuples
@@ -250,9 +249,9 def get_limit(limit_opt):
250 try:
249 try:
251 limit = int(limit_opt)
250 limit = int(limit_opt)
252 except ValueError:
251 except ValueError:
253 raise Abort(_("limit must be a positive integer"))
252 raise util.Abort(_("limit must be a positive integer"))
254 if limit <= 0:
253 if limit <= 0:
255 raise Abort(_("limit must be positive"))
254 raise util.Abort(_("limit must be positive"))
256 else:
255 else:
257 limit = sys.maxint
256 limit = sys.maxint
258 return limit
257 return limit
@@ -269,7 +268,7 def check_unsupported_flags(opts):
269 "only_merges", "user", "only_branch", "prune", "newest_first",
268 "only_merges", "user", "only_branch", "prune", "newest_first",
270 "no_merges", "include", "exclude"]:
269 "no_merges", "include", "exclude"]:
271 if op in opts and opts[op]:
270 if op in opts and opts[op]:
272 raise Abort(_("--graph option is incompatible with --%s") % op)
271 raise util.Abort(_("--graph option is incompatible with --%s") % op)
273
272
274
273
275 def graphlog(ui, repo, path=None, **opts):
274 def graphlog(ui, repo, path=None, **opts):
@@ -290,7 +289,7 def graphlog(ui, repo, path=None, **opts
290 return
289 return
291
290
292 if path:
291 if path:
293 path = canonpath(repo.root, os.getcwd(), path)
292 path = util.canonpath(repo.root, os.getcwd(), path)
294 if path: # could be reset in canonpath
293 if path: # could be reset in canonpath
295 revdag = filerevs(repo, path, start, stop)
294 revdag = filerevs(repo, path, start, stop)
296 else:
295 else:
General Comments 0
You need to be logged in to leave comments. Login now