261 if topic: |
261 if topic: |
262 with repo.wlock(): |
262 with repo.wlock(): |
263 with repo.vfs.open('topic', 'w') as f: |
263 with repo.vfs.open('topic', 'w') as f: |
264 f.write(topic) |
264 f.write(topic) |
265 return |
265 return |
|
266 _listtopics(ui, repo) |
|
267 |
|
268 @command('stack [TOPIC]', [] + commands.formatteropts) |
|
269 def cmdstack(ui, repo, topic='', **opts): |
|
270 """list all changesets in a topic |
|
271 |
|
272 List the current topic by default.""" |
|
273 return stack.showstack(ui, repo, topic, opts) |
|
274 |
|
275 def _listtopics(ui, repo): |
266 current = repo.currenttopic |
276 current = repo.currenttopic |
267 for t in sorted(repo.topics): |
277 for t in sorted(repo.topics): |
268 marker = '*' if t == current else ' ' |
278 marker = '*' if t == current else ' ' |
269 ui.write(' %s %s\n' % (marker, t)) |
279 ui.write(' %s %s\n' % (marker, t)) |
270 |
|
271 @command('stack [TOPIC]', [] + commands.formatteropts) |
|
272 def cmdstack(ui, repo, topic='', **opts): |
|
273 """list all changesets in a topic |
|
274 |
|
275 List the current topic by default.""" |
|
276 return stack.showstack(ui, repo, topic, opts) |
|
277 |
280 |
278 def summaryhook(ui, repo): |
281 def summaryhook(ui, repo): |
279 t = repo.currenttopic |
282 t = repo.currenttopic |
280 if not t: |
283 if not t: |
281 return |
284 return |