Show More
@@ -1,25 +1,26 b'' | |||||
1 | # Extension to write out fake unsupported records into the merge state |
|
1 | # Extension to write out fake unsupported records into the merge state | |
2 | # |
|
2 | # | |
3 | # |
|
3 | # | |
4 |
|
4 | |||
5 | from __future__ import absolute_import |
|
5 | from __future__ import absolute_import | |
6 |
|
6 | |||
7 | from mercurial import ( |
|
7 | from mercurial import ( | |
8 | cmdutil, |
|
8 | cmdutil, | |
9 | merge, |
|
9 | merge, | |
10 | ) |
|
10 | ) | |
11 |
|
11 | |||
12 | cmdtable = {} |
|
12 | cmdtable = {} | |
13 | command = cmdutil.command(cmdtable) |
|
13 | command = cmdutil.command(cmdtable) | |
14 |
|
14 | |||
15 | @command('fakemergerecord', |
|
15 | @command('fakemergerecord', | |
16 | [('X', 'mandatory', None, 'add a fake mandatory record'), |
|
16 | [('X', 'mandatory', None, 'add a fake mandatory record'), | |
17 | ('x', 'advisory', None, 'add a fake advisory record')], '') |
|
17 | ('x', 'advisory', None, 'add a fake advisory record')], '') | |
18 | def fakemergerecord(ui, repo, *pats, **opts): |
|
18 | def fakemergerecord(ui, repo, *pats, **opts): | |
19 | ms = merge.mergestate.read(repo) |
|
19 | with repo.wlock(): | |
20 | records = ms._makerecords() |
|
20 | ms = merge.mergestate.read(repo) | |
21 | if opts.get('mandatory'): |
|
21 | records = ms._makerecords() | |
22 |
|
|
22 | if opts.get('mandatory'): | |
23 | if opts.get('advisory'): |
|
23 | records.append(('X', 'mandatory record')) | |
24 |
|
|
24 | if opts.get('advisory'): | |
25 | ms._writerecords(records) |
|
25 | records.append(('x', 'advisory record')) | |
|
26 | ms._writerecords(records) |
General Comments 0
You need to be logged in to leave comments.
Login now