##// END OF EJS Templates
Move finding/checking the log limit to cmdutil
Thomas Arendsen Hein -
r6190:a79d9408 default
parent child Browse files
Show More
@@ -89,6 +89,19 b' def logmessage(opts):'
89 (logfile, inst.strerror))
89 (logfile, inst.strerror))
90 return message
90 return message
91
91
92 def loglimit(opts):
93 """get the log limit according to option -l/--limit"""
94 limit = opts.get('limit')
95 if limit:
96 try:
97 limit = int(limit)
98 except ValueError:
99 raise util.Abort(_('limit must be a positive integer'))
100 if limit <= 0: raise util.Abort(_('limit must be positive'))
101 else:
102 limit = sys.maxint
103 return limit
104
92 def setremoteconfig(ui, opts):
105 def setremoteconfig(ui, opts):
93 "copy remote options to ui tree"
106 "copy remote options to ui tree"
94 if opts.get('ssh'):
107 if opts.get('ssh'):
@@ -1699,14 +1699,7 b' def log(ui, repo, *pats, **opts):'
1699 get = util.cachefunc(lambda r: repo.changectx(r).changeset())
1699 get = util.cachefunc(lambda r: repo.changectx(r).changeset())
1700 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
1700 changeiter, matchfn = cmdutil.walkchangerevs(ui, repo, pats, get, opts)
1701
1701
1702 if opts['limit']:
1702 limit = cmdutil.loglimit(opts)
1703 try:
1704 limit = int(opts['limit'])
1705 except ValueError:
1706 raise util.Abort(_('limit must be a positive integer'))
1707 if limit <= 0: raise util.Abort(_('limit must be positive'))
1708 else:
1709 limit = sys.maxint
1710 count = 0
1703 count = 0
1711
1704
1712 if opts['copies'] and opts['rev']:
1705 if opts['copies'] and opts['rev']:
General Comments 0
You need to be logged in to leave comments. Login now