comparison tests/test_single_dir_push.py @ 1549:8410a978c650

compathacks: be compatible with upstream 8a0cac20a1ad memfilectx change See hg change 8a0cac20a1ad. Since the interface has changed more than one time, switch to explicit keywords arguments to avoid surprises. Since hgsubversion targets hg >= 3.2.4, drop support for hg 3.0 and 3.1 here.
author Jun Wu <quark@fb.com>
date Tue, 19 Dec 2017 14:29:55 -0800
parents 0ebcc5bbf692
children d55c9d0ba350
comparison
equal deleted inserted replaced
1548:7f83be82d03f 1549:8410a978c650
22 layout='single', 22 layout='single',
23 subdir='') 23 subdir='')
24 def file_callback(repo, memctx, path): 24 def file_callback(repo, memctx, path):
25 if path == 'adding_file': 25 if path == 'adding_file':
26 return compathacks.makememfilectx(repo, 26 return compathacks.makememfilectx(repo,
27 memctx=memctx,
27 path=path, 28 path=path,
28 data='foo', 29 data='foo',
29 islink=False, 30 islink=False,
30 isexec=False, 31 isexec=False,
31 copied=False) 32 copied=False)
32 elif path == 'adding_binary': 33 elif path == 'adding_binary':
33 return compathacks.makememfilectx(repo, 34 return compathacks.makememfilectx(repo,
35 memctx=memctx,
34 path=path, 36 path=path,
35 data='\0binary', 37 data='\0binary',
36 islink=False, 38 islink=False,
37 isexec=False, 39 isexec=False,
38 copied=False) 40 copied=False)
63 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 65 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
64 layout='single', 66 layout='single',
65 subdir='trunk') 67 subdir='trunk')
66 def filectxfn(repo, memctx, path): 68 def filectxfn(repo, memctx, path):
67 return compathacks.makememfilectx(repo, 69 return compathacks.makememfilectx(repo,
70 memctx=memctx,
68 path=path, 71 path=path,
69 data='contents of %s' % path, 72 data='contents of %s' % path,
70 islink=False, 73 islink=False,
71 isexec=False, 74 isexec=False,
72 copied=False) 75 copied=False)
97 layout='single', 100 layout='single',
98 subdir='trunk') 101 subdir='trunk')
99 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'}) 102 self.add_svn_rev(repo_path, {'trunk/alpha': 'Changed'})
100 def file_callback(repo, memctx, path): 103 def file_callback(repo, memctx, path):
101 return compathacks.makememfilectx(repo, 104 return compathacks.makememfilectx(repo,
105 memctx=memctx,
102 path=path, 106 path=path,
103 data='data of %s' % path, 107 data='data of %s' % path,
104 islink=False, 108 islink=False,
105 isexec=False, 109 isexec=False,
106 copied=False) 110 copied=False)
129 subdir='') 133 subdir='')
130 def file_callback(data): 134 def file_callback(data):
131 def cb(repo, memctx, path): 135 def cb(repo, memctx, path):
132 if path == data: 136 if path == data:
133 return compathacks.makememfilectx(repo, 137 return compathacks.makememfilectx(repo,
138 memctx=memctx,
134 path=path, 139 path=path,
135 data=data, 140 data=data,
136 islink=False, 141 islink=False,
137 isexec=False, 142 isexec=False,
138 copied=False) 143 copied=False)
178 test_util.dispatch(cmd) 183 test_util.dispatch(cmd)
179 184
180 def file_callback(repo, memctx, path): 185 def file_callback(repo, memctx, path):
181 if path == 'adding_file': 186 if path == 'adding_file':
182 return compathacks.makememfilectx(repo, 187 return compathacks.makememfilectx(repo,
188 memctx=memctx,
183 path=path, 189 path=path,
184 data='foo', 190 data='foo',
185 islink=False, 191 islink=False,
186 isexec=False, 192 isexec=False,
187 copied=False) 193 copied=False)