mirror of https://github.com/NaN-tic/hgreview.git
Remove review_id file on commit
This commit is contained in:
parent
0634d5332a
commit
4cb3e35cb6
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue