Show More
@@ -85,24 +85,25 b" don't allow marking or unmarking driver-" | |||||
85 |
|
85 | |||
86 | $ cat > $TESTTMP/markdriver.py << EOF |
|
86 | $ cat > $TESTTMP/markdriver.py << EOF | |
87 | > '''mark and unmark files as driver-resolved''' |
|
87 | > '''mark and unmark files as driver-resolved''' | |
88 | > from mercurial import merge, registrar, scmutil |
|
88 | > from mercurial import merge, registrar, scmutil, pycompat | |
89 | > cmdtable = {} |
|
89 | > cmdtable = {} | |
90 | > command = registrar.command(cmdtable) |
|
90 | > command = registrar.command(cmdtable) | |
91 | > @command(b'markdriver', |
|
91 | > @command(b'markdriver', | |
92 | > [('u', 'unmark', None, '')], |
|
92 | > [(b'u', b'unmark', None, b'')], | |
93 | > 'FILE...') |
|
93 | > b'FILE...') | |
94 | > def markdriver(ui, repo, *pats, **opts): |
|
94 | > def markdriver(ui, repo, *pats, **opts): | |
95 | > wlock = repo.wlock() |
|
95 | > wlock = repo.wlock() | |
|
96 | > opts = pycompat.byteskwargs(opts) | |||
96 | > try: |
|
97 | > try: | |
97 | > ms = merge.mergestate.read(repo) |
|
98 | > ms = merge.mergestate.read(repo) | |
98 | > m = scmutil.match(repo[None], pats, opts) |
|
99 | > m = scmutil.match(repo[None], pats, opts) | |
99 | > for f in ms: |
|
100 | > for f in ms: | |
100 | > if not m(f): |
|
101 | > if not m(f): | |
101 | > continue |
|
102 | > continue | |
102 | > if not opts['unmark']: |
|
103 | > if not opts[b'unmark']: | |
103 | > ms.mark(f, 'd') |
|
104 | > ms.mark(f, b'd') | |
104 | > else: |
|
105 | > else: | |
105 | > ms.mark(f, 'u') |
|
106 | > ms.mark(f, b'u') | |
106 | > ms.commit() |
|
107 | > ms.commit() | |
107 | > finally: |
|
108 | > finally: | |
108 | > wlock.release() |
|
109 | > wlock.release() |
General Comments 0
You need to be logged in to leave comments.
Login now