Remove review_id file on commit

This commit is contained in:
Nicolas ?vrard 2012-09-27 22:14:17 +02:00
parent 0634d5332a
commit 4cb3e35cb6
3 changed files with 20 additions and 0 deletions

View File

@ -3,6 +3,7 @@
Follow mercurial version while keeping compatibility
Added clean option
Added nested option
Remove review_id file on commit
* Version 0.2 - 2011-11-27
Initial release

View File

@ -13,6 +13,7 @@ from hashlib import md5
from mercurial.__version__ import version as mercurial_version
from mercurial import hg, extensions, util
from mercurial import patch, mdiff, node, commands
from mercurial import extensions
try:
test = map(int, mercurial_version.split('.')) >= [1, 9]
@ -369,3 +370,14 @@ cmdtable = {
('', 'fetch', None, 'Fetch patch and apply to repository'),
], "hg review [options]"),
}
def review_commit(orig, ui, repo, *pats, **opts):
issue_file = _get_issue_file(repo)
if os.path.isfile(issue_file):
os.unlink(issue_file)
orig(ui, repo, *pats, **opts)
def uisetup(ui):
extensions.wrapcommand(commands.table, 'commit', review_commit)

View File

@ -40,3 +40,10 @@ The two repositories should be identical
$ cd ..
$ diff -x .hg -r a b
If we do a commit then the file review_id will disappear:
$ cd a
$ hg commit -m 'Commit change'
$ test -e .hg/review_id || echo OK
OK