305 if util.safehasattr(repo, 'names'): |
305 if util.safehasattr(repo, 'names'): |
306 repo.names.addnamespace(namespaces.namespace( |
306 repo.names.addnamespace(namespaces.namespace( |
307 'topics', 'topic', namemap=_namemap, nodemap=_nodemap, |
307 'topics', 'topic', namemap=_namemap, nodemap=_nodemap, |
308 listnames=lambda repo: repo.topics)) |
308 listnames=lambda repo: repo.topics)) |
309 |
309 |
310 @command('topics [TOPIC]', [ |
310 @command('topics', [ |
311 ('', 'clear', False, 'clear active topic if any'), |
311 ('', 'clear', False, 'clear active topic if any'), |
312 ('r', 'rev', '', 'revset of existing revisions', _('REV')), |
312 ('r', 'rev', '', 'revset of existing revisions', _('REV')), |
313 ('l', 'list', False, 'show the stack of changeset in the topic'), |
313 ('l', 'list', False, 'show the stack of changeset in the topic'), |
314 ('', 'age', False, 'show when you last touched the topics') |
314 ('', 'age', False, 'show when you last touched the topics') |
315 ] + commands.formatteropts) |
315 ] + commands.formatteropts, |
|
316 _('hg topics [TOPIC]')) |
316 def topics(ui, repo, topic='', clear=False, rev=None, list=False, **opts): |
317 def topics(ui, repo, topic='', clear=False, rev=None, list=False, **opts): |
317 """View current topic, set current topic, change topic for a set of revisions, or see all topics. |
318 """View current topic, set current topic, change topic for a set of revisions, or see all topics. |
318 |
319 |
319 Clear topic on existing topiced revisions: |
320 Clear topic on existing topiced revisions: |
320 `hg topic --rev <related revset> --clear` |
321 `hg topic --rev <related revset> --clear` |
363 if topic: |
364 if topic: |
364 return _changecurrenttopic(repo, topic) |
365 return _changecurrenttopic(repo, topic) |
365 |
366 |
366 _listtopics(ui, repo, opts) |
367 _listtopics(ui, repo, opts) |
367 |
368 |
368 @command('stack [TOPIC]', [] + commands.formatteropts) |
369 @command('stack', [ |
|
370 ] + commands.formatteropts, |
|
371 _('hg stack [TOPIC]')) |
369 def cmdstack(ui, repo, topic='', **opts): |
372 def cmdstack(ui, repo, topic='', **opts): |
370 """list all changesets in a topic and other information |
373 """list all changesets in a topic and other information |
371 |
374 |
372 List the current topic by default. |
375 List the current topic by default. |
373 |
376 |