mercurial/commands.py
changeset 14216 e3da95f84bcd
parent 14198 8f11fd321014
child 14220 21b8ce4d3331
equal deleted inserted replaced
14215:e5a59d31bb04 14216:e3da95f84bcd
    97     Returns 0 on success.
    97     Returns 0 on success.
    98     """
    98     """
    99     if opts.get('follow'):
    99     if opts.get('follow'):
   100         # --follow is deprecated and now just an alias for -f/--file
   100         # --follow is deprecated and now just an alias for -f/--file
   101         # to mimic the behavior of Mercurial before version 1.5
   101         # to mimic the behavior of Mercurial before version 1.5
   102         opts['file'] = 1
   102         opts['file'] = True
   103 
   103 
   104     datefunc = ui.quiet and util.shortdate or util.datestr
   104     datefunc = ui.quiet and util.shortdate or util.datestr
   105     getdate = util.cachefunc(lambda x: datefunc(x[0].date()))
   105     getdate = util.cachefunc(lambda x: datefunc(x[0].date()))
   106 
   106 
   107     if not pats:
   107     if not pats:
   114              ('file', lambda x: x[0].path()),
   114              ('file', lambda x: x[0].path()),
   115             ]
   115             ]
   116 
   116 
   117     if (not opts.get('user') and not opts.get('changeset')
   117     if (not opts.get('user') and not opts.get('changeset')
   118         and not opts.get('date') and not opts.get('file')):
   118         and not opts.get('date') and not opts.get('file')):
   119         opts['number'] = 1
   119         opts['number'] = True
   120 
   120 
   121     linenumber = opts.get('line_number') is not None
   121     linenumber = opts.get('line_number') is not None
   122     if linenumber and (not opts.get('changeset')) and (not opts.get('number')):
   122     if linenumber and (not opts.get('changeset')) and (not opts.get('number')):
   123         raise util.Abort(_('at least one of -n/-c is required for -l'))
   123         raise util.Abort(_('at least one of -n/-c is required for -l'))
   124 
   124