Mercurial > hg
annotate tests/fakemergerecord.py @ 29218:fd288d118074
largefiles: send statlfile remote calls only for nonexisting locally files
Files that are already in local store should be checked locally. The problem
with this implementation is how difference in messages between local and remote
checks should look like. For now local errors for file missing and content
corrupted looks like this:
'changeset cset: filename references missing storepath\n'
'changeset cset: filename references corrupted storepath\n'
for remote it looks like:
'changeset cset: filename missing\n'
'changeset cset: filename: contents differ\n'
Contents differ error for remote calls is never raised currently - for now
statlfile implementation lacks checking file content.
author | liscju <piotr.listkiewicz@gmail.com> |
---|---|
date | Mon, 09 May 2016 10:05:32 +0200 |
parents | a01ecbcfaf84 |
children | b303b3817d0e |
rev | line source |
---|---|
27027
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
1 # Extension to write out fake unsupported records into the merge state |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
2 # |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
3 # |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
4 |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
5 from __future__ import absolute_import |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
6 |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
7 from mercurial import ( |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
8 cmdutil, |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
9 merge, |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
10 ) |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
11 |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
12 cmdtable = {} |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
13 command = cmdutil.command(cmdtable) |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
14 |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
15 @command('fakemergerecord', |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
16 [('X', 'mandatory', None, 'add a fake mandatory record'), |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
17 ('x', 'advisory', None, 'add a fake advisory record')], '') |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
18 def fakemergerecord(ui, repo, *pats, **opts): |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
19 ms = merge.mergestate.read(repo) |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
20 records = ms._makerecords() |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
21 if opts.get('mandatory'): |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
22 records.append(('X', 'mandatory record')) |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
23 if opts.get('advisory'): |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
24 records.append(('x', 'advisory record')) |
a01ecbcfaf84
mergestate: handle additional record types specially
Siddharth Agarwal <sid0@fb.com>
parents:
diff
changeset
|
25 ms._writerecords(records) |