changeset 22266:711de9dcb1d3

annotate: abort early if no file is specified This change is intended to move the getdate function near the opmap table.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 16 Aug 2014 17:59:26 +0900
parents fe22d86a8992
children 90cf454edd70
files mercurial/commands.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Aug 20 15:07:25 2014 -0700
+++ b/mercurial/commands.py	Sat Aug 16 17:59:26 2014 +0900
@@ -260,6 +260,9 @@
 
     Returns 0 on success.
     """
+    if not pats:
+        raise util.Abort(_('at least one filename or pattern is required'))
+
     if opts.get('follow'):
         # --follow is deprecated and now just an alias for -f/--file
         # to mimic the behavior of Mercurial before version 1.5
@@ -267,10 +270,6 @@
 
     datefunc = ui.quiet and util.shortdate or util.datestr
     getdate = util.cachefunc(lambda x: datefunc(x[0].date()))
-
-    if not pats:
-        raise util.Abort(_('at least one filename or pattern is required'))
-
     hexfn = ui.debugflag and hex or short
 
     opmap = [('user', ' ', lambda x: ui.shortuser(x[0].user())),