equal
deleted
inserted
replaced
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 |