mercurial/commands.py
changeset 2778 2e0cd25fe4ac
parent 2777 21e571c21a6b
child 2779 12a7bfcafd8f
equal deleted inserted replaced
2777:21e571c21a6b 2778:2e0cd25fe4ac
   128     follow = opts.get('follow')
   128     follow = opts.get('follow')
   129 
   129 
   130     if repo.changelog.count() == 0:
   130     if repo.changelog.count() == 0:
   131         return [], False, matchfn
   131         return [], False, matchfn
   132 
   132 
   133     revs = map(int, revrange(ui, repo, opts['rev'] or ['tip:0']))
   133     if follow:
       
   134         p = repo.dirstate.parents()[0]
       
   135         if p == nullid:
       
   136             ui.warn(_('No working directory revision; defaulting to tip\n'))
       
   137             start = 'tip'
       
   138         else:
       
   139             start = repo.changelog.rev(p)
       
   140         defrange = '%s:0' % start
       
   141     else:
       
   142         defrange = 'tip:0'
       
   143     revs = map(int, revrange(ui, repo, opts['rev'] or [defrange]))
   134     wanted = {}
   144     wanted = {}
   135     slowpath = anypats
   145     slowpath = anypats
   136     fncache = {}
   146     fncache = {}
   137 
   147 
   138     chcache = {}
   148     chcache = {}
  2014 
  2024 
  2015     File history is shown without following rename or copy history of
  2025     File history is shown without following rename or copy history of
  2016     files.  Use -f/--follow with a file name to follow history across
  2026     files.  Use -f/--follow with a file name to follow history across
  2017     renames and copies. --follow without a file name will only show
  2027     renames and copies. --follow without a file name will only show
  2018     ancestors or descendants of the starting revision.
  2028     ancestors or descendants of the starting revision.
       
  2029 
       
  2030     If no revision range is specified, the default is tip:0 unless
       
  2031     --follow is set, in which case the working directory parent is
       
  2032     used as the starting revision.
  2019 
  2033 
  2020     By default this command outputs: changeset id and hash, tags,
  2034     By default this command outputs: changeset id and hash, tags,
  2021     non-trivial parents, user, date and time, and a summary for each
  2035     non-trivial parents, user, date and time, and a summary for each
  2022     commit. When the -v/--verbose switch is used, the list of changed
  2036     commit. When the -v/--verbose switch is used, the list of changed
  2023     files and full commit message is shown.
  2037     files and full commit message is shown.