[Python-Dev] cvs to bzr?

Neil Schemenauer nas at arctrix.com
Sun Aug 14 19:21:07 CEST 2005


On Sat, Aug 13, 2005 at 06:03:46PM -0600, Neil Schemenauer wrote:
> Haven't tried it but should work:
> 
>     http://darcs.net/DarcsWiki/Tailor 

After applying the attached patch, this command seemed to work for
converting the initial revision:

~/src/cvsync/tailor.py --source-kind cvs --target-kind bzr \
    --bootstrap --repository ~/Python/python-cvsroot -m python \
    --revision r16b1 py_bzr

After, I think this command is supposed to bring the bzr repostiory
up-to-date:

    cd py_bzr; ~/src/cvsync/tailor.py -v 

It does not seem to work for me (it only updates one file and then
quits).  cvs2svn seems to be much more mature.

  Neil
-------------- next part --------------
diff -rN -u old-cvsync/vcpx/bzr.py new-cvsync/vcpx/bzr.py
--- old-cvsync/vcpx/bzr.py	2005-08-14 09:43:15.000000000 -0600
+++ new-cvsync/vcpx/bzr.py	2005-08-14 10:38:02.000000000 -0600
@@ -29,14 +29,23 @@
 
     ## SyncronizableTargetWorkingDir
 
-    def _addEntries(self, root, entries):
-        """
-        Add a sequence of entries.
-        """
+    def _addPathnames(self, root, entries):
+        c = SystemCommand(working_dir=root, command="bzr add --no-recurse"
+                                                    " %(entries)s")
+        c(entries=' '.join([shrepr(e) for e in entries]))
 
+    def _addSubtree(self, root, *entries):
         c = SystemCommand(working_dir=root, command="bzr add %(entries)s")
-        c(entries=' '.join([shrepr(e.name) for e in entries]))
+        c(entries=' '.join([shrepr(e) for e in entries]))
 
+    def _removePathnames(self, root, names):
+        pass # bzr handles this itself
+
+    def _renamePathname(self, root, oldname, newname):
+        c = SystemCommand(working_dir=root,
+                          command="bzr mv %(old)s %(new)s")
+        c(old=shrepr(oldname), new=shrepr(newname))
+        
     def _commit(self,root, date, author, remark, changelog=None, entries=None):
         """
         Commit the changeset.
@@ -112,7 +121,7 @@
 
         # Create the .bzrignore file, that contains a glob per line,
         # with all known VCs metadirs to be skipped.
-        ignore = open(join(root, '.hgignore'), 'w')
+        ignore = open(join(root, '.bzrignore'), 'w')
         ignore.write('\n'.join(['(^|/)%s($|/)' % md
                                 for md in IGNORED_METADIRS]))
         ignore.write('\ntailor.log\ntailor.info\n')



More information about the Python-Dev mailing list