Show More
@@ -287,7 +287,6 b' def demo(ui, repo, *args, **opts):' | |||
|
287 | 287 | ui.write('%s = %s\n' % (k, v)) |
|
288 | 288 | |
|
289 | 289 | fn = 'demo.txt' |
|
290 | branchname = 'demobranch' | |
|
291 | 290 | tmpdir = tempfile.mkdtemp('', 'kwdemo.') |
|
292 | 291 | ui.note(_('creating temporary repository at %s\n') % tmpdir) |
|
293 | 292 | repo = localrepo.localrepository(ui, tmpdir, True) |
@@ -333,25 +332,17 b' def demo(ui, repo, *args, **opts):' | |||
|
333 | 332 | keywords = '$' + '$\n$'.join(sorted(kwmaps.keys())) + '$\n' |
|
334 | 333 | repo.wopener(fn, 'w').write(keywords) |
|
335 | 334 | repo.add([fn]) |
|
336 | path = repo.wjoin(fn) | |
|
337 | ui.note(_('\nkeywords written to %s:\n') % path) | |
|
335 | ui.note(_('\nkeywords written to %s:\n') % fn) | |
|
338 | 336 | ui.note(keywords) |
|
339 | ui.note('\nhg -R "%s" branch "%s"\n' % (tmpdir, branchname)) | |
|
340 | # silence branch command if not verbose | |
|
341 | quiet = ui.quiet | |
|
342 | ui.quiet = not ui.verbose | |
|
343 | commands.branch(ui, repo, branchname) | |
|
344 | ui.quiet = quiet | |
|
337 | repo.dirstate.setbranch('demobranch') | |
|
345 | 338 | for name, cmd in ui.configitems('hooks'): |
|
346 | 339 | if name.split('.', 1)[0].find('commit') > -1: |
|
347 | 340 | repo.ui.setconfig('hooks', name, '') |
|
348 | ui.note(_('unhooked all commit hooks\n')) | |
|
349 | 341 | msg = _('hg keyword configuration and expansion example') |
|
350 |
ui.note("hg |
|
|
342 | ui.note("hg ci -m '%s'\n" % msg) | |
|
351 | 343 | repo.commit(text=msg) |
|
352 | 344 | ui.status(_('\n\tkeywords expanded\n')) |
|
353 | 345 | ui.write(repo.wread(fn)) |
|
354 | ui.debug('\nremoving temporary repository %s\n' % tmpdir) | |
|
355 | 346 | shutil.rmtree(tmpdir, ignore_errors=True) |
|
356 | 347 | |
|
357 | 348 | def expand(ui, repo, *pats, **opts): |
General Comments 0
You need to be logged in to leave comments.
Login now