12 if hooktype != 'pretxncommit': |
12 if hooktype != 'pretxncommit': |
13 # bail out with error |
13 # bail out with error |
14 return True |
14 return True |
15 |
15 |
16 # reparse args, opts again as pretxncommit hook is silent about them |
16 # reparse args, opts again as pretxncommit hook is silent about them |
17 sysargs, globalopts, cmdopts = commands.parse(ui, sys.argv[1:])[2:] |
17 cmd, sysargs, globalopts, cmdopts = commands.parse(ui, sys.argv[1:])[1:] |
|
18 # exclude tagging |
|
19 if repr(cmd).split()[1] == 'tag': |
|
20 return False |
18 files, match, anypats = cmdutil.matchpats(repo, sysargs, cmdopts) |
21 files, match, anypats = cmdutil.matchpats(repo, sysargs, cmdopts) |
19 |
22 |
20 # validity checks should have been done already |
23 # validity checks should have been done already |
21 modified, added = repo.status(files=files, match=match)[:2] |
24 modified, added = repo.status(files=files, match=match)[:2] |
22 candidates = modified + added |
25 candidates = [f for f in modified + added if not f.startswith('.hg')] |
23 |
26 |
24 if not candidates: |
27 if not candidates: |
25 return False |
28 return False |
26 |
29 |
27 # only check files that have hgkwencode assigned as encode filter |
30 # only check files that have hgkwencode assigned as encode filter |