Show More
@@ -111,6 +111,15 b' def loglimit(opts):' | |||||
111 | limit = None |
|
111 | limit = None | |
112 | return limit |
|
112 | return limit | |
113 |
|
113 | |||
|
114 | def revsingle(repo, revspec, default=None): | |||
|
115 | if not revspec: | |||
|
116 | return repo[default] | |||
|
117 | ||||
|
118 | l = revrange(repo, [revspec]) | |||
|
119 | if len(l) < 1: | |||
|
120 | raise util.Abort("empty revision set") | |||
|
121 | return repo[l[-1]] | |||
|
122 | ||||
114 | def revpair(repo, revs): |
|
123 | def revpair(repo, revs): | |
115 | if not revs: |
|
124 | if not revs: | |
116 | return repo.dirstate.parents()[0], None |
|
125 | return repo.dirstate.parents()[0], None |
@@ -634,7 +634,7 b' def cat(ui, repo, file1, *pats, **opts):' | |||||
634 |
|
634 | |||
635 | Returns 0 on success. |
|
635 | Returns 0 on success. | |
636 | """ |
|
636 | """ | |
637 |
ctx = repo |
|
637 | ctx = cmdutil.revsingle(repo, opts.get('rev')) | |
638 | err = 1 |
|
638 | err = 1 | |
639 | m = cmdutil.match(repo, (file1,) + pats, opts) |
|
639 | m = cmdutil.match(repo, (file1,) + pats, opts) | |
640 | for abs in ctx.walk(m): |
|
640 | for abs in ctx.walk(m): |
General Comments 0
You need to be logged in to leave comments.
Login now