Show More
@@ -1,19 +1,6 b'' | |||
|
1 | 1 | # Subversion 1.4/1.5 Python API backend |
|
2 | 2 | # |
|
3 | 3 | # Copyright(C) 2007 Daniel Holth et al |
|
4 | # | |
|
5 | # Configuration options: | |
|
6 | # | |
|
7 | # convert.svn.trunk | |
|
8 | # Relative path to the trunk (default: "trunk") | |
|
9 | # convert.svn.branches | |
|
10 | # Relative path to tree of branches (default: "branches") | |
|
11 | # convert.svn.tags | |
|
12 | # Relative path to tree of tags (default: "tags") | |
|
13 | # | |
|
14 | # Set these in a hgrc, or on the command line as follows: | |
|
15 | # | |
|
16 | # hg convert --config convert.svn.trunk=wackoname [...] | |
|
17 | 4 | |
|
18 | 5 | import locale |
|
19 | 6 | import os |
@@ -213,7 +200,6 b' class svn_source(converter_source):' | |||
|
213 | 200 | raise MissingTool(_('Subversion python bindings are too old, 1.4 ' |
|
214 | 201 | 'or later required')) |
|
215 | 202 | |
|
216 | self.encoding = locale.getpreferredencoding() | |
|
217 | 203 | self.lastrevs = {} |
|
218 | 204 | |
|
219 | 205 | latest = None |
@@ -524,8 +510,6 b' class svn_source(converter_source):' | |||
|
524 | 510 | self.convertfp.write('%s %d\n' % (destrev, self.revnum(rev))) |
|
525 | 511 | self.convertfp.flush() |
|
526 | 512 | |
|
527 | # -- helper functions -- | |
|
528 | ||
|
529 | 513 | def revid(self, revnum, module=None): |
|
530 | 514 | if not module: |
|
531 | 515 | module = self.module |
@@ -598,7 +582,8 b' class svn_source(converter_source):' | |||
|
598 | 582 | It is not uncommon for two nearby revisions to cancel each other |
|
599 | 583 | out, e.g. 'I copied trunk into a subdirectory of itself instead |
|
600 | 584 | of making a branch'. The converted repository is significantly |
|
601 |
smaller if we ignore such revisions. |
|
|
585 | smaller if we ignore such revisions. | |
|
586 | """ | |
|
602 | 587 | self.blacklist = set() |
|
603 | 588 | blacklist = self.blacklist |
|
604 | 589 | for line in file("blacklist.txt", "r"): |
@@ -700,18 +685,14 b' class svn_source(converter_source):' | |||
|
700 | 685 | fromkind = svn.ra.check_path(self.ra, entrypath.strip('/'), fromrev) |
|
701 | 686 | self.reparent(prevmodule) |
|
702 | 687 | |
|
703 |
if fromkind == svn.core.svn_node_file: |
|
|
688 | if fromkind == svn.core.svn_node_file: | |
|
704 | 689 | entries.append(self.recode(entry)) |
|
705 | 690 | elif fromkind == svn.core.svn_node_dir: |
|
706 | # print "Deleted/moved non-file:", revnum, path, ent | |
|
707 | # children = self._find_children(path, revnum - 1) | |
|
708 | # print ("find children %s@%d from %d action %s" % | |
|
709 | # (path, revnum, ent.copyfrom_rev, ent.action)) | |
|
710 | # Sometimes this is tricky. For example: in | |
|
711 | # The Subversion Repository revision 6940 a dir | |
|
712 | # was copied and one of its files was deleted | |
|
713 | # from the new location in the same commit. This | |
|
714 | # code can't deal with that yet. | |
|
691 | # Sometimes this is tricky. For example: in The | |
|
692 | # Subversion Repository revision 6940 a dir was | |
|
693 | # copied and one of its files was deleted from the | |
|
694 | # new location in the same commit. This code can't | |
|
695 | # deal with that yet. | |
|
715 | 696 | if ent.action == 'C': |
|
716 | 697 | children = self._find_children(path, fromrev) |
|
717 | 698 | else: |
@@ -737,21 +718,11 b' class svn_source(converter_source):' | |||
|
737 | 718 | self.ui.debug(_('unknown path in revision %d: %s\n') % \ |
|
738 | 719 | (revnum, path)) |
|
739 | 720 | elif kind == svn.core.svn_node_dir: |
|
740 | # Should probably synthesize normal file entries | |
|
741 | # and handle as above to clean up copy/rename handling. | |
|
742 | ||
|
743 | 721 | # If the directory just had a prop change, |
|
744 | 722 | # then we shouldn't need to look for its children. |
|
745 | 723 | if ent.action == 'M': |
|
746 | 724 | continue |
|
747 | 725 | |
|
748 | # Also this could create duplicate entries. Not sure | |
|
749 | # whether this will matter. Maybe should make entries a set. | |
|
750 | # print "Changed directory", revnum, path, ent.action, \ | |
|
751 | # ent.copyfrom_path, ent.copyfrom_rev | |
|
752 | # This will fail if a directory was copied | |
|
753 | # from another branch and then some of its files | |
|
754 | # were deleted in the same transaction. | |
|
755 | 726 | children = sorted(self._find_children(path, revnum)) |
|
756 | 727 | for child in children: |
|
757 | 728 | # Can we move a child directory and its |
@@ -759,15 +730,13 b' class svn_source(converter_source):' | |||
|
759 | 730 | # cause problems if instead of revnum -1, |
|
760 | 731 | # we have to look in (copyfrom_path, revnum - 1) |
|
761 | 732 | entrypath = self.getrelpath("/" + child) |
|
762 | # print child, self.module, entrypath | |
|
763 | 733 | if entrypath: |
|
764 | 734 | # Need to filter out directories here... |
|
765 | 735 | kind = self._checkpath(entrypath, revnum) |
|
766 | 736 | if kind != svn.core.svn_node_dir: |
|
767 | 737 | entries.append(self.recode(entrypath)) |
|
768 | 738 | |
|
769 | # Copies here (must copy all from source) Probably not | |
|
770 | # a real problem for us if source does not exist | |
|
739 | # Handle directory copies | |
|
771 | 740 | if not ent.copyfrom_path or not parents: |
|
772 | 741 | continue |
|
773 | 742 | # Copy sources not in parent revisions cannot be |
General Comments 0
You need to be logged in to leave comments.
Login now