changeset 1:b30690538379 0.13

initialize branch:0.13 from svn The content corresponds to: {{{ svn export https://svn.edgewall.org/repos/trac/plugins/0.13/mercurial-plugin }}} at revision r10937. i.e. http://trac.edgewall.org/changeset/10937/plugins/0.13/mercurial-plugin
author Christian Boos <christian.boos@free.fr>
date Sat, 09 Jun 2012 19:34:03 +0200
parents a97b17f1bac7
children bbb6e28dc488
files README setup.py tracext/hg/backend.py tracext/hg/hooks.py
diffstat 4 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/README	Sat Jun 09 19:27:02 2012 +0200
+++ b/README	Sat Jun 09 19:34:03 2012 +0200
@@ -8,16 +8,14 @@
 
 === Trac ===
 
-This plugin for Trac 0.12 doesn't yet work with Trac ''trunk'',
-but requires the ''multirepos'' branch (to be integrated in trunk 
-shortly):
+This plugin for Trac 0.13 works with Trac ''trunk'':
 {{{
-svn co http://svn.edgewall.com/repos/trac/sandbox/multirepos
+svn co http://svn.edgewall.org/repos/trac/trunk
 }}}
 
 and install from there:
 {{{
-$ cd multirepos
+$ cd trunk
 $ python setup.py egg_info
 $ python setup.py install
 }}}
--- a/setup.py	Sat Jun 09 19:27:02 2012 +0200
+++ b/setup.py	Sat Jun 09 19:34:03 2012 +0200
@@ -36,16 +36,16 @@
 TracMercurial = 'http://trac.edgewall.org/wiki/TracMercurial'
 
 setup(name='TracMercurial',
-      install_requires='Trac >=0.12dev-r9125',
-      description='Mercurial plugin for Trac multirepos branch',
+      install_requires='Trac >=0.13dev',
+      description='Mercurial plugin for Trac (0.13 branch)',
       keywords='trac scm plugin mercurial hg',
-      version='0.12.0.29',
+      version='0.13.0.5',
       url=TracMercurial,
       license='GPL',
       author='Christian Boos',
       author_email='cboos@edgewall.org',
       long_description="""
-      This plugin for Trac 0.12 provides support for the Mercurial SCM.
+      This plugin for Trac 0.13 provides support for the Mercurial SCM.
 
       See %s for more details.
       """ % TracMercurial,
--- a/tracext/hg/backend.py	Sat Jun 09 19:27:02 2012 +0200
+++ b/tracext/hg/backend.py	Sat Jun 09 19:34:03 2012 +0200
@@ -722,6 +722,9 @@
         for c in ctx.children():
             return c.hex() # always follow first child
    
+    def parent_revs(self, rev):
+        return [p.hex() for p in self.changectx(rev).parents()]
+
     def rev_older_than(self, rev1, rev2):
         # FIXME use == and ancestors?
         return self.short_rev(rev1) < self.short_rev(rev2)
@@ -1183,10 +1186,9 @@
                                          [c.hex() for c in children])
         if self.branch:
             properties['hg-Branch'] = (self.repos, [self.branch])
-        tags = self.ctx.tags()
+        tags = self.get_tags()
         if len(tags):
-            properties['hg-Tags'] = (self.repos, 
-                                     [self.repos.to_u(t) for t in tags])
+            properties['hg-Tags'] = (self.repos, tags) 
         for k, v in self.ctx.extra().iteritems():
             if k != 'branch':
                 properties['hg-' + k] = (self.repos, v)
@@ -1238,5 +1240,9 @@
 
     def get_branches(self):
         """Yield branch names to which this changeset belong."""
-        return self.branch and [(self.branch, 
-                                 len(self.ctx.children()) == 0)] or []
+        if self.branch:
+            yield (self.branch, len(self.ctx.children()) == 0)
+
+    def get_tags(self):
+        """Yield tag names to which this changeset belong."""
+        return [self.repos.to_u(t) for t in self.ctx.tags()]
--- a/tracext/hg/hooks.py	Sat Jun 09 19:27:02 2012 +0200
+++ b/tracext/hg/hooks.py	Sat Jun 09 19:34:03 2012 +0200
@@ -106,7 +106,7 @@
         try:
             revs_per_call = int(ui.config('trac', 'revs_per_call'))
         except (TypeError, ValueError):
-            revs_per_call = os.name == 'nt' and 160 or 1000
+            revs_per_call = 160 if os.name == 'nt' else 1000
 
         trac_admin = expand_path(trac_admin)
         for i in xrange(0, len(revs), revs_per_call):