Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
$ hg resolve -u | $ hg resolve -u | ||||
$ cd .. | $ cd .. | ||||
$ rmdir nested | $ rmdir nested | ||||
don't allow marking or unmarking driver-resolved files | don't allow marking or unmarking driver-resolved files | ||||
$ cat > $TESTTMP/markdriver.py << EOF | $ cat > $TESTTMP/markdriver.py << EOF | ||||
> '''mark and unmark files as driver-resolved''' | > '''mark and unmark files as driver-resolved''' | ||||
> from mercurial import merge, registrar, scmutil | > from mercurial import merge, registrar, scmutil, pycompat | ||||
> cmdtable = {} | > cmdtable = {} | ||||
> command = registrar.command(cmdtable) | > command = registrar.command(cmdtable) | ||||
> @command(b'markdriver', | > @command(b'markdriver', | ||||
> [('u', 'unmark', None, '')], | > [(b'u', b'unmark', None, b'')], | ||||
> 'FILE...') | > b'FILE...') | ||||
> def markdriver(ui, repo, *pats, **opts): | > def markdriver(ui, repo, *pats, **opts): | ||||
> wlock = repo.wlock() | > wlock = repo.wlock() | ||||
> opts = pycompat.byteskwargs(opts) | |||||
> try: | > try: | ||||
> ms = merge.mergestate.read(repo) | > ms = merge.mergestate.read(repo) | ||||
> m = scmutil.match(repo[None], pats, opts) | > m = scmutil.match(repo[None], pats, opts) | ||||
> for f in ms: | > for f in ms: | ||||
> if not m(f): | > if not m(f): | ||||
> continue | > continue | ||||
> if not opts['unmark']: | > if not opts[b'unmark']: | ||||
> ms.mark(f, 'd') | > ms.mark(f, b'd') | ||||
> else: | > else: | ||||
> ms.mark(f, 'u') | > ms.mark(f, b'u') | ||||
> ms.commit() | > ms.commit() | ||||
> finally: | > finally: | ||||
> wlock.release() | > wlock.release() | ||||
> EOF | > EOF | ||||
$ hg --config extensions.markdriver=$TESTTMP/markdriver.py markdriver file1 | $ hg --config extensions.markdriver=$TESTTMP/markdriver.py markdriver file1 | ||||
$ hg resolve --list | $ hg resolve --list | ||||
D file1 | D file1 | ||||
U file2 | U file2 |