mercurial/commands.py
changeset 22266 711de9dcb1d3
parent 22248 75618a223e18
child 22272 406181ee335f
equal deleted inserted replaced
22265:fe22d86a8992 22266:711de9dcb1d3
   258     anyway, although the results will probably be neither useful
   258     anyway, although the results will probably be neither useful
   259     nor desirable.
   259     nor desirable.
   260 
   260 
   261     Returns 0 on success.
   261     Returns 0 on success.
   262     """
   262     """
       
   263     if not pats:
       
   264         raise util.Abort(_('at least one filename or pattern is required'))
       
   265 
   263     if opts.get('follow'):
   266     if opts.get('follow'):
   264         # --follow is deprecated and now just an alias for -f/--file
   267         # --follow is deprecated and now just an alias for -f/--file
   265         # to mimic the behavior of Mercurial before version 1.5
   268         # to mimic the behavior of Mercurial before version 1.5
   266         opts['file'] = True
   269         opts['file'] = True
   267 
   270 
   268     datefunc = ui.quiet and util.shortdate or util.datestr
   271     datefunc = ui.quiet and util.shortdate or util.datestr
   269     getdate = util.cachefunc(lambda x: datefunc(x[0].date()))
   272     getdate = util.cachefunc(lambda x: datefunc(x[0].date()))
   270 
       
   271     if not pats:
       
   272         raise util.Abort(_('at least one filename or pattern is required'))
       
   273 
       
   274     hexfn = ui.debugflag and hex or short
   273     hexfn = ui.debugflag and hex or short
   275 
   274 
   276     opmap = [('user', ' ', lambda x: ui.shortuser(x[0].user())),
   275     opmap = [('user', ' ', lambda x: ui.shortuser(x[0].user())),
   277              ('number', ' ', lambda x: str(x[0].rev())),
   276              ('number', ' ', lambda x: str(x[0].rev())),
   278              ('changeset', ' ', lambda x: hexfn(x[0].node())),
   277              ('changeset', ' ', lambda x: hexfn(x[0].node())),