##// END OF EJS Templates
commands: Add 'hg log --branch' and deprecate 'hg log --only-branch'...
Steve Losh -
r10957:0d5f139b default
parent child Browse files
Show More
@@ -2157,6 +2157,8 b' def log(ui, repo, *pats, **opts):'
2157 if opts["date"]:
2157 if opts["date"]:
2158 df = util.matchdate(opts["date"])
2158 df = util.matchdate(opts["date"])
2159
2159
2160 opts['branch'] += opts.get('only_branch')
2161
2160 displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
2162 displayer = cmdutil.show_changeset(ui, repo, opts, True, matchfn)
2161 def prep(ctx, fns):
2163 def prep(ctx, fns):
2162 rev = ctx.rev()
2164 rev = ctx.rev()
@@ -2166,7 +2168,7 b' def log(ui, repo, *pats, **opts):'
2166 return
2168 return
2167 if opts.get('only_merges') and len(parents) != 2:
2169 if opts.get('only_merges') and len(parents) != 2:
2168 return
2170 return
2169 if opts.get('only_branch') and ctx.branch() not in opts['only_branch']:
2171 if opts.get('branch') and ctx.branch() not in opts['branch']:
2170 return
2172 return
2171 if df and not df(ctx.date()[0]):
2173 if df and not df(ctx.date()[0]):
2172 return
2174 return
@@ -3739,8 +3741,10 b' table = {'
3739 ('', 'removed', None, _('include revisions where files were removed')),
3741 ('', 'removed', None, _('include revisions where files were removed')),
3740 ('m', 'only-merges', None, _('show only merges')),
3742 ('m', 'only-merges', None, _('show only merges')),
3741 ('u', 'user', [], _('revisions committed by user')),
3743 ('u', 'user', [], _('revisions committed by user')),
3742 ('b', 'only-branch', [],
3744 ('', 'only-branch', [],
3743 _('show only changesets within the given named branch')),
3745 _('show only changesets within the given named branch (DEPRECATED)')),
3746 ('b', 'branch', [],
3747 _('show changesets within the given named branch')),
3744 ('P', 'prune', [],
3748 ('P', 'prune', [],
3745 _('do not display revision or any of its ancestors')),
3749 _('do not display revision or any of its ancestors')),
3746 ] + logopts + walkopts,
3750 ] + logopts + walkopts,
@@ -171,7 +171,7 b' diff: rev, change, text, git, nodates, s'
171 export: output, switch-parent, rev, text, git, nodates
171 export: output, switch-parent, rev, text, git, nodates
172 forget: include, exclude
172 forget: include, exclude
173 init: ssh, remotecmd
173 init: ssh, remotecmd
174 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, prune, patch, git, limit, no-merges, style, template, include, exclude
174 log: follow, follow-first, date, copies, keyword, rev, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, style, template, include, exclude
175 merge: force, rev, preview
175 merge: force, rev, preview
176 pull: update, force, rev, branch, ssh, remotecmd
176 pull: update, force, rev, branch, ssh, remotecmd
177 push: force, rev, branch, ssh, remotecmd
177 push: force, rev, branch, ssh, remotecmd
@@ -135,4 +135,34 b' hg log -u "User One <user1@example.org>"'
135 hg log -u "user1" -u "user2"
135 hg log -u "user1" -u "user2"
136 hg log -u "user3"
136 hg log -u "user3"
137
137
138 cd ..
139
140 hg init branches
141 cd branches
142
143 echo a > a
144 hg ci -A -m "commit on default"
145 hg branch test
146 echo b > b
147 hg ci -A -m "commit on test"
148
149 hg up default
150 echo c > c
151 hg ci -A -m "commit on default"
152 hg up test
153 echo c > c
154 hg ci -A -m "commit on test"
155
156 echo '% log -b default'
157 hg log -b default
158
159 echo '% log -b test'
160 hg log -b test
161
162 echo '% log -b dummy'
163 hg log -b dummy
164
165 echo '% log -b default -b test'
166 hg log -b default -b test
167
138 exit 0
168 exit 0
@@ -324,3 +324,65 b' user: User One <user1@example.org'
324 date: Thu Jan 01 00:00:00 1970 +0000
324 date: Thu Jan 01 00:00:00 1970 +0000
325 summary: a
325 summary: a
326
326
327 adding a
328 marked working directory as branch test
329 adding b
330 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
331 adding c
332 created new head
333 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
334 adding c
335 % log -b default
336 changeset: 2:c3a4f03cc9a7
337 parent: 0:24427303d56f
338 user: test
339 date: Thu Jan 01 00:00:00 1970 +0000
340 summary: commit on default
341
342 changeset: 0:24427303d56f
343 user: test
344 date: Thu Jan 01 00:00:00 1970 +0000
345 summary: commit on default
346
347 % log -b test
348 changeset: 3:f5d8de11c2e2
349 branch: test
350 tag: tip
351 parent: 1:d32277701ccb
352 user: test
353 date: Thu Jan 01 00:00:00 1970 +0000
354 summary: commit on test
355
356 changeset: 1:d32277701ccb
357 branch: test
358 user: test
359 date: Thu Jan 01 00:00:00 1970 +0000
360 summary: commit on test
361
362 % log -b dummy
363 % log -b default -b test
364 changeset: 3:f5d8de11c2e2
365 branch: test
366 tag: tip
367 parent: 1:d32277701ccb
368 user: test
369 date: Thu Jan 01 00:00:00 1970 +0000
370 summary: commit on test
371
372 changeset: 2:c3a4f03cc9a7
373 parent: 0:24427303d56f
374 user: test
375 date: Thu Jan 01 00:00:00 1970 +0000
376 summary: commit on default
377
378 changeset: 1:d32277701ccb
379 branch: test
380 user: test
381 date: Thu Jan 01 00:00:00 1970 +0000
382 summary: commit on test
383
384 changeset: 0:24427303d56f
385 user: test
386 date: Thu Jan 01 00:00:00 1970 +0000
387 summary: commit on default
388
General Comments 0
You need to be logged in to leave comments. Login now