Mercurial > hg
comparison hgext/keyword.py @ 21981:897bee697d51
keyword: really clean up kwdemo temp tree
author | Christian Ebert <blacktrash@gmx.net> |
---|---|
date | Sat, 02 Aug 2014 09:44:11 +0100 |
parents | 44efd5b9ce45 |
children | 97d5aca9bb66 |
comparison
equal
deleted
inserted
replaced
21980:f4e5753745e9 | 21981:897bee697d51 |
---|---|
85 from mercurial import commands, context, cmdutil, dispatch, filelog, extensions | 85 from mercurial import commands, context, cmdutil, dispatch, filelog, extensions |
86 from mercurial import localrepo, match, patch, templatefilters, templater, util | 86 from mercurial import localrepo, match, patch, templatefilters, templater, util |
87 from mercurial import scmutil, pathutil | 87 from mercurial import scmutil, pathutil |
88 from mercurial.hgweb import webcommands | 88 from mercurial.hgweb import webcommands |
89 from mercurial.i18n import _ | 89 from mercurial.i18n import _ |
90 import os, re, shutil, tempfile | 90 import os, re, tempfile |
91 | 91 |
92 cmdtable = {} | 92 cmdtable = {} |
93 command = cmdutil.command(cmdtable) | 93 command = cmdutil.command(cmdtable) |
94 testedwith = 'internal' | 94 testedwith = 'internal' |
95 | 95 |
448 msg = _('hg keyword configuration and expansion example') | 448 msg = _('hg keyword configuration and expansion example') |
449 ui.note(("hg ci -m '%s'\n" % msg)) | 449 ui.note(("hg ci -m '%s'\n" % msg)) |
450 repo.commit(text=msg) | 450 repo.commit(text=msg) |
451 ui.status(_('\n\tkeywords expanded\n')) | 451 ui.status(_('\n\tkeywords expanded\n')) |
452 ui.write(repo.wread(fn)) | 452 ui.write(repo.wread(fn)) |
453 shutil.rmtree(tmpdir, ignore_errors=True) | 453 for root, dirs, files in os.walk(tmpdir, topdown=False): |
454 for f in files: | |
455 util.unlink(os.path.join(root, f)) | |
456 for d in dirs: | |
457 os.rmdir(os.path.join(root, d)) | |
458 os.rmdir(tmpdir) | |
454 | 459 |
455 @command('kwexpand', | 460 @command('kwexpand', |
456 commands.walkopts, | 461 commands.walkopts, |
457 _('hg kwexpand [OPTION]... [FILE]...'), | 462 _('hg kwexpand [OPTION]... [FILE]...'), |
458 inferrepo=True) | 463 inferrepo=True) |