hgext/graphlog.py
changeset 17162 868c256cb51b
parent 17120 01d847e0fdc9
child 17163 4c5d7124661a
equal deleted inserted replaced
17161:be016e96117a 17162:868c256cb51b
    12 revision graph is also shown.
    12 revision graph is also shown.
    13 '''
    13 '''
    14 
    14 
    15 from mercurial.cmdutil import show_changeset
    15 from mercurial.cmdutil import show_changeset
    16 from mercurial.i18n import _
    16 from mercurial.i18n import _
    17 from mercurial.node import nullrev
       
    18 from mercurial import cmdutil, commands, extensions, scmutil
    17 from mercurial import cmdutil, commands, extensions, scmutil
    19 from mercurial import hg, util, graphmod, templatekw, revset
    18 from mercurial import hg, util, graphmod, templatekw, revset
    20 
    19 
    21 cmdtable = {}
    20 cmdtable = {}
    22 command = cmdutil.command(cmdtable)
    21 command = cmdutil.command(cmdtable)
   224         ui.write(ln.rstrip() + '\n')
   223         ui.write(ln.rstrip() + '\n')
   225 
   224 
   226     # ... and start over
   225     # ... and start over
   227     state[0] = coldiff
   226     state[0] = coldiff
   228     state[1] = idx
   227     state[1] = idx
   229 
       
   230 def get_revs(repo, rev_opt):
       
   231     if rev_opt:
       
   232         revs = scmutil.revrange(repo, rev_opt)
       
   233         if len(revs) == 0:
       
   234             return (nullrev, nullrev)
       
   235         return (max(revs), min(revs))
       
   236     else:
       
   237         return (len(repo) - 1, 0)
       
   238 
   228 
   239 def check_unsupported_flags(pats, opts):
   229 def check_unsupported_flags(pats, opts):
   240     for op in ["newest_first"]:
   230     for op in ["newest_first"]:
   241         if op in opts and opts[op]:
   231         if op in opts and opts[op]:
   242             raise util.Abort(_("-G/--graph option is incompatible with --%s")
   232             raise util.Abort(_("-G/--graph option is incompatible with --%s")