Mercurial > hgsubversion
comparison svnwrap/svn_swig_wrapper.py @ 70:49b7cbe4c8e3
push_cmd: handle copies at file level
Mercurial store knows only file-level copies, directory copies are handle with
heuristics. Implement the former one in svn backends.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 05 Nov 2008 13:37:08 +0100 |
parents | a31968146f3c |
children | 450d5d9d3b80 |
comparison
equal
deleted
inserted
replaced
69:63ece4ea25c9 | 70:49b7cbe4c8e3 |
---|---|
262 while len(revisions) > 0: | 262 while len(revisions) > 0: |
263 yield revisions[0] | 263 yield revisions[0] |
264 revisions.pop(0) | 264 revisions.pop(0) |
265 | 265 |
266 def commit(self, paths, message, file_data, base_revision, dirs, | 266 def commit(self, paths, message, file_data, base_revision, dirs, |
267 properties): | 267 properties, copies): |
268 """Commits the appropriate targets from revision in editor's store. | 268 """Commits the appropriate targets from revision in editor's store. |
269 """ | 269 """ |
270 self.init_ra_and_client() | 270 self.init_ra_and_client() |
271 commit_info = [] | 271 commit_info = [] |
272 def commit_cb(_commit_info, pool): | 272 def commit_cb(_commit_info, pool): |
294 compute_delta = True | 294 compute_delta = True |
295 if action == 'modify': | 295 if action == 'modify': |
296 baton = editor.open_file(path, parent, base_revision, pool) | 296 baton = editor.open_file(path, parent, base_revision, pool) |
297 elif action == 'add': | 297 elif action == 'add': |
298 try: | 298 try: |
299 baton = editor.add_file(path, parent, None, -1, pool) | 299 frompath, fromrev = copies.get(path, (None, -1)) |
300 if frompath: | |
301 frompath = self.svn_url + '/' + frompath | |
302 baton = editor.add_file(path, parent, frompath, fromrev, pool) | |
300 except (core.SubversionException, TypeError), e: #pragma: no cover | 303 except (core.SubversionException, TypeError), e: #pragma: no cover |
301 print e.message | 304 print e.message |
302 raise | 305 raise |
303 elif action == 'delete': | 306 elif action == 'delete': |
304 baton = editor.delete_entry(path, base_revision, parent, pool) | 307 baton = editor.delete_entry(path, base_revision, parent, pool) |