Hi,

  I am the Debian maintainer for the tailor package. I have a few
bugs (and patches) to report about tailor.

  At first, here is some general information.
All debian bugs related to tailor can be found here :
http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=tailor
  I do not know what to do about #353139 and #354164

  I also have some patches that I apply to tailor in my debian package.
They are available as plain file on my web page:
http://dept-info.labri.fr/~danjean/deb.html#tailor
I will wrote them here with comments. I would like you to tell me
if they are good (and need to be applied upstream) or if they are
wrong.

* This first patch (proposed in bug #353139) seems to have already
proposed to you but not applied (according to the bug submitter)...

Index: tailor-0.9.21/vcpx/repository.py
===================================================================
--- tailor-0.9.21.orig/vcpx/repository.py       2006-03-29 18:40:25.000000000
+0200
+++ tailor-0.9.21/vcpx/repository.py    2006-04-19 00:38:40.000000000 +0200
@@ -413,5 +413,6 @@
     def command(self, *args, **kwargs):
         if args:
             if args[0] == 'tree-lint':
+                args = list(args)
                 args[0] = 'lint'
         return TlaRepository.command(self, *args, **kwargs)

* This second patch fix cvs conversion when the repository is locked
(see bug #360076)

Index: tailor-0.9.21/vcpx/cvs.py
===================================================================
--- tailor-0.9.21.orig/vcpx/cvs.py      2006-03-29 18:40:25.000000000 +0200
+++ tailor-0.9.21/vcpx/cvs.py   2006-04-19 00:41:49.000000000 +0200
@@ -24,7 +24,7 @@

     # handle locked files by taking only the first part of the
     # revision string to handle gracefully lines like "1.1 locked"
-    rev = rev.split(' ')[0]
+    rev = rev.split()[0]

     r = [int(n) for n in rev.split('.')]
     # convert "magic branch numbers" like 1.2.0.2 to regular
@@ -261,7 +261,7 @@
         # Don't just knock off the leading 'revision ' here.
         # There may be locks, in which case we get output like:
         # 'revision 1.4    locked by: mem;'.
-        rev = revision[:-1].split(' ')[1]
+        rev = revision[:-1].split()[1]

         infoline = self.__readline()

* This third one adds the '--verbose' option to rsync when tailor is in
debug mode (I find it useful when trying to debug tailor with svn<->hg)

Index: tailor-0.9.20/vcpx/dualwd.py
===================================================================
--- tailor-0.9.20.orig/vcpx/dualwd.py   2005-12-23 17:08:00.000000000 +0100
+++ tailor-0.9.20/vcpx/dualwd.py        2006-04-17 12:47:19.000000000 +0200
@@ -41,6 +41,8 @@

         self.source = source_repo.workingDir()
         self.target = target_repo.workingDir()
+        self.project= source_repo.projectref()
+        self.repo_name= source_repo.name

         sbdir = self.source.basedir
         tbdir = self.target.basedir
@@ -107,6 +109,8 @@

     def _syncTargetWithSource(self):
         cmd = ['rsync', '--delete', '--archive']
+        if self.project.config.get(self.repo_name, 'debug', False):
+            cmd.append('--verbose')
         now = datetime.now()
         if hasattr(self, '_last_rsync'):
             last = self._last_rsync

* I wrote the 4th one when I tried to set up bi-directional conversion
between mercurial and svn.
  The first part allow to start a hg repository when it already exists
(in my test, the initial import svn->hg create the hg directory and I
need the patch to start the hg->svn part)
  The second part fixes a bug that I look for a long time:
commands.pull() [and probably commands.tag(), I do not test this part]
need to use the ui from the repo. The ui from self._getUI() does not
include the option from the .hg/hgrc repository file (only options from
global hgrc files). So default patch were not found.

Index: tailor-0.9.21/vcpx/hglib.py
===================================================================
--- tailor-0.9.21.orig/vcpx/hglib.py    2006-03-29 18:40:25.000000000 +0200
+++ tailor-0.9.21/vcpx/hglib.py 2006-04-19 00:47:50.000000000 +0200
@@ -30,13 +30,27 @@
         # later. So a partial checkout is a full clone followed by an
update
         # directly to the desired revision.

-        # Hg won't check out into an existing directory
-        checkoutdir = os.path.join(self.basedir,".hgtmp")
-        commands.clone(self._ui, self.repository.repository, checkoutdir,
-                       noupdate=True, ssh=None, remotecmd=None,
pull=None, rev=None)
-        os.rename(os.path.join(checkoutdir, ".hg"),
-                  os.path.join(self.basedir,".hg"))
-        os.rmdir(checkoutdir)
+        # If no basedir does not exist, create it
+        if not os.path.exists(self.basedir):
+            os.mkdir(self.basedir)
+
+        # clone it only if .hg does not exist
+        if not os.path.exists(os.path.join(self.basedir, ".hg")):
+            # Hg won't check out into an existing directory
+            checkoutdir = os.path.join(self.basedir,".hgtmp")
+            commands.clone(self._ui, self.repository.repository,
checkoutdir,
+                           noupdate=True, ssh=None, remotecmd=None,
pull=None, rev=None)
+            os.rename(os.path.join(checkoutdir, ".hg"),
+                      os.path.join(self.basedir,".hg"))
+            os.rmdir(checkoutdir)
+        else:
+            # Does hgrc exists ? If not, we write one
+            hgrc=os.path.join(self.basedir, ".hg", "hgrc")
+            if not os.path.exists(hgrc):
+                hgrc=file(hgrc, "w")
+                hgrc.write("[paths]\ndefault = %s\ndefault-push = %s\n" %
+                    (self.repository.repository,
self.repository.repository))
+                hgrc.close()

         repo = self._getRepo()
         node = self._getNode(repo, revision)
@@ -49,10 +63,9 @@

     def _getUpstreamChangesets(self, sincerev):
         """Fetch new changesets from the source"""
-        ui = self._getUI()
         repo = self._getRepo()

-        commands.pull(ui, repo, "default", ssh=None, remotecmd=None,
update=None, rev=None)
+        commands.pull(repo.ui, repo, "default", ssh=None,
remotecmd=None, update=None, rev=None)

         from mercurial.node import bin
         for rev in xrange(repo.changelog.rev(bin(sincerev)) + 1,
repo.changelog.count()):
@@ -241,7 +254,7 @@
                 parent = repo.changelog.parents(parent)[0]
         except KeyError:
             pass
-        commands.tag(self._getUI(), repo, tag, **opts)
+        commands.tag(repo.ui, repo, tag, **opts)

     def _defaultOpts(self, cmd):
         # Not sure this is public. commands.parse might be, but this

* The 5th one makes tailor not trying to remove the loghandler if it has
not been set up. It can probably be improved: someone that knows python
better than me will be able to check for the presence of self.loghandler
without using another variable...

Index: tailor-0.9.21/vcpx/project.py
===================================================================
--- tailor-0.9.21.orig/vcpx/project.py  2006-03-29 18:40:25.000000000 +0200
+++ tailor-0.9.21/vcpx/project.py       2006-04-19 00:42:11.000000000 +0200
@@ -79,6 +79,7 @@
         Initialize a new instance representing the project `name`.
         """

+        self.loghandler_added=False
         if not config.has_section(name):
             raise UnknownProjectError("'%s' is not a known project" % name)

@@ -126,6 +127,7 @@
         self.loghandler.setFormatter(formatter)
         self.loghandler.setLevel(DEBUG)
         tailorlog.addHandler(self.loghandler)
+        self.loghandler_added=True

         self.source = self.__loadRepository('source')
         self.target = self.__loadRepository('target')
@@ -161,7 +163,8 @@

     def __del__(self):
         from logging import getLogger
-        getLogger('tailor').removeHandler(self.loghandler)
+        if self.loghandler_added:
+            getLogger('tailor').removeHandler(self.loghandler)

     def __loadRepository(self, which):
         """

* The last one is a manpage generated from help2man (and rewritten).
It is a bit long, you can find it on my webpage with the others.
You can be interested by including it with your upstream sources.


  Best regards,
    Vincent

PS:
  If someone want to automatically received all the Debian bug reports
about tailor, he can subscribe to the Package Tracking System on:
http://packages.qa.debian.org/t/tailor.html

_______________________________________________
Tailor mailing list
[email protected]
http://lists.zooko.com/mailman/listinfo/tailor

Reply via email to