[tryton-debian-vcs] hgnested branch upstream updated. upstream/0.7-1-g1a36c72

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Fri Aug 12 15:28:45 UTC 2016


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/hgnested.git;a=commitdiff;h=upstream/0.7-1-g1a36c72

commit 1a36c72a49e5d25f66dd2d293bbedc0ba4a90e46
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Aug 12 16:57:24 2016 +0200

    Adding upstream version 0.8.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 163e602..9f534d4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+Version 0.8 - 2016-08-10
+* Add support for mercurial 3.8 and 3.9
+* Drop support for mercurial 3.5
+* Add support for mercurial 3.6
+
 Version 0.7 - 2015-08-26
 * Improve performance by skipping .hg directories
 * Add support for tortoisehg
diff --git a/PKG-INFO b/PKG-INFO
index 50d94ef..e1a70bf 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: hgnested
-Version: 0.7
+Version: 0.8
 Summary: Mercurial extension to work with nested repositories
 Home-page: http://bitbucket.org/cedk/hgnested
 Author: B2CK
@@ -18,8 +18,8 @@ Description: hgnested
         repositories at once like pull, push etc.  It allow also to fetch a complete
         tree of repositories through ssh or http.
         
-        To enable the "hgnested" extension, create an entry for it in your hgrc, like
-        this::
+        To enable the "hgnested" extension, create an entry for it in your Mercurial
+        configuration file, like this::
         
             [extensions]
             hgnested =
diff --git a/README b/README
index 53db11f..c05124b 100644
--- a/README
+++ b/README
@@ -9,8 +9,8 @@ The extension allow to apply common Mercurial commands to all the  nested
 repositories at once like pull, push etc.  It allow also to fetch a complete
 tree of repositories through ssh or http.
 
-To enable the "hgnested" extension, create an entry for it in your hgrc, like
-this::
+To enable the "hgnested" extension, create an entry for it in your Mercurial
+configuration file, like this::
 
     [extensions]
     hgnested =
diff --git a/hgnested.egg-info/PKG-INFO b/hgnested.egg-info/PKG-INFO
index 50d94ef..e1a70bf 100644
--- a/hgnested.egg-info/PKG-INFO
+++ b/hgnested.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: hgnested
-Version: 0.7
+Version: 0.8
 Summary: Mercurial extension to work with nested repositories
 Home-page: http://bitbucket.org/cedk/hgnested
 Author: B2CK
@@ -18,8 +18,8 @@ Description: hgnested
         repositories at once like pull, push etc.  It allow also to fetch a complete
         tree of repositories through ssh or http.
         
-        To enable the "hgnested" extension, create an entry for it in your hgrc, like
-        this::
+        To enable the "hgnested" extension, create an entry for it in your Mercurial
+        configuration file, like this::
         
             [extensions]
             hgnested =
diff --git a/hgnested.egg-info/requires.txt b/hgnested.egg-info/requires.txt
index 6a23881..3a85f32 100644
--- a/hgnested.egg-info/requires.txt
+++ b/hgnested.egg-info/requires.txt
@@ -1 +1 @@
-Mercurial >= 2.9.0
\ No newline at end of file
+Mercurial >= 3.6.0
diff --git a/hgnested/__init__.py b/hgnested/__init__.py
index 8121dd6..2a55807 100755
--- a/hgnested/__init__.py
+++ b/hgnested/__init__.py
@@ -7,9 +7,6 @@ This extension provides commands that apply to all the nested repositories.
 It was inspired by the forest extension by Robin Farine.
 '''
 
-testedwith = '2.9 3.0 3.1 3.2 3.3 3.4 3.5'
-buglink = 'https://bitbucket.org/cedk/hgnested/issues'
-
 import os
 import time
 from functools import partial
@@ -17,126 +14,100 @@ from mercurial import hg
 from mercurial import commands, localrepo, hgweb
 from mercurial import util
 from mercurial import cmdutil
+from mercurial import extensions
 from mercurial import wireproto
 from mercurial.error import CapabilityError
 from mercurial.scmutil import walkrepos
 from mercurial.i18n import _
 
-try:
-    from mercurial import sshpeer, httppeer
-except ImportError:
-    from mercurial import sshrepo, httprepo
-    sshpeer, httppeer = None, None
+__version__ = '0.8'
+testedwith = '3.6 3.7 3.8 3.9'
+buglink = 'https://bitbucket.org/cedk/hgnested/issues'
 
-__version__ = '0.7'
+cmdtable = {}
+command = cmdutil.command(cmdtable)
 
 _nested_cache = {}
 _nested_refreshinterval = 20
 
-_capabilities_parent = wireproto.capabilities
 
-
-def capabilities(repo, proto):
-    caps = _capabilities_parent(repo, proto).split()
+def _capabilities(orig, repo, proto):
+    caps = orig(repo, proto)
     caps.append('nested')
-    return ' '.join(caps)
-wireproto.capabilities = capabilities
-wireproto.commands['capabilities'] = ((capabilities,) +
-        wireproto.commands['capabilities'][1:])
+    return caps
+extensions.wrapfunction(wireproto, '_capabilities', _capabilities)
 
 
+ at wireproto.wireprotocommand('nested')
 def nested(repo, proto):
     '''Return a list of nested repositories.'''
     return "\n".join(repo.nested)
 
-wireproto.commands['nested'] = (nested, '')
-
 
- at property
-def _localrepo_nested(self):
-    '''Return a list of nested repositories.'''
-    cache = _nested_cache.setdefault(self.root, {
-        'lastrefresh': 0,
-        'nested': None,
-        })
-    if cache['lastrefresh'] + _nested_refreshinterval > time.time():
-        return cache['nested']
-    res = {}
-    paths = [self.root]
-    while paths:
-        path = paths.pop()
-        if os.path.realpath(path) in res:
-            continue
-        for root, dirs, files in os.walk(path):
-            for dir in dirs[:]:
-                if dir == '.hg':
-                    res[os.path.realpath(root)] = os.path.abspath(root)
-                    proot = os.path.join(root, '.hg', 'patches')
-                    if os.path.isdir(os.path.join(proot, '.hg')):
-                        res[os.path.realpath(proot)] = os.path.abspath(proot)
-                    dirs.remove('.hg')  # Don't visit .hg directory
-                else:
-                    path = os.path.join(root, dir)
-                    if (os.path.islink(path)
-                            and os.path.realpath(path) not in res):
-                        paths.append(path)
-    prefix = len(self.root) + 1
-    res = [x[prefix:] or '.' for x in res.itervalues()]
-    res.sort()
-    cache['nested'] = res
-    cache['lastrefresh'] = time.time()
-    return res
-
-localrepo.localrepository.nested = _localrepo_nested
-
-
- at property
-def _sshpeer_nested(self):
-    '''Return a list of nested repositories.'''
-    if hasattr(self, 'capable'):
-        test = self.capable('nested')
-    else:
-        test = 'nested' in self.capabilities
-    if not test:
-        raise util.Abort(_("Remote repository doesn't support "
-            "the nested extension."))
-    if hasattr(self, '_call'):
-        return self._call('nested').splitlines()
-    return self.call('nested').splitlines()
-
-if sshpeer:
-    sshpeer.sshpeer.nested = _sshpeer_nested
-else:
-    sshrepo.sshrepository.nested = _sshpeer_nested
-
-
- at property
-def _httppeer_nested(self):
-    '''Return a list of nested repositories.'''
-    if hasattr(self, 'capable'):
-        test = self.capable('nested')
-    else:
-        test = 'nested' in self.capabilities
-    if not test:
-        raise util.Abort(_("Remote repository doesn't support "
-            "the nested extension."))
-    if hasattr(self, '_call'):
-        return self._call('nested').split()
-    return self.do_read('nested').split()
-
-if httppeer:
-    httppeer.httppeer.nested = _httppeer_nested
-else:
-    httprepo.httprepository.nested = _httppeer_nested
-
-
-_hgwebdir_refresh_parent = hgweb.hgwebdir_mod.hgwebdir.refresh
-
-
-def _hgwebdir_refresh(self):
-    if self.lastrefresh + self.refreshinterval > time.time():
+def reposetup(ui, repo):
+    if isinstance(repo, localrepo.localrepository):
+        class nestedrepo(repo.__class__):
+            @property
+            def nested(self):
+                '''Return a list of nested repositories.'''
+                cache = _nested_cache.setdefault(self.root, {
+                    'lastrefresh': 0,
+                    'nested': None,
+                    })
+                if (cache['lastrefresh'] + _nested_refreshinterval
+                        > time.time()):
+                    return cache['nested']
+                res = {}
+                paths = [self.root]
+                while paths:
+                    path = paths.pop()
+                    if os.path.realpath(path) in res:
+                        continue
+                    for root, dirs, files in os.walk(path):
+                        realroot = os.path.realpath(root)
+                        absroot = os.path.abspath(root)
+                        for dir in dirs[:]:
+                            if dir == '.hg':
+                                res[realroot] = absroot
+                                proot = os.path.join(root, '.hg', 'patches')
+                                if os.path.isdir(os.path.join(proot, '.hg')):
+                                    realproot = os.path.realpath(proot)
+                                    absproot = os.path.abspath(proot)
+                                    res[realproot] = absproot
+                                dirs.remove('.hg')  # Don't visit .hg directory
+                            else:
+                                path = os.path.join(root, dir)
+                                if (os.path.islink(path)
+                                        and os.path.realpath(path) not in res):
+                                    paths.append(path)
+                prefix = len(self.root) + 1
+                res = [x[prefix:] or '.' for x in res.itervalues()]
+                res.sort()
+                cache['nested'] = res
+                cache['lastrefresh'] = time.time()
+                return res
+        repo.__class__ = nestedrepo
+
+    if isinstance(repo, wireproto.wirepeer):
+        class nestedwirepeer(repo.__class__):
+            @property
+            def nested(self):
+                '''Return a list of nested repositories.'''
+                if not self.capable('nested'):
+                    raise util.Abort(_("Remote repository doesn't support "
+                        "the nested extension."))
+                return self._call('nested').splitlines()
+        repo.__class__ = nestedwirepeer
+
+
+def _hgwebdir_refresh(orig, self):
+    refreshinterval = 20
+    if self.ui:
+        refreshinterval = self.ui.configint('web', 'refreshinterval',
+            refreshinterval)
+    if self.lastrefresh + refreshinterval > time.time():
         return
-    _hgwebdir_refresh_parent(self)
+    orig(self)
     for prefix, root in self.ui.configitems('collections'):
         prefix = util.pconvert(prefix)
         for path in walkrepos(root, followsym=True):
@@ -150,8 +121,8 @@ def _hgwebdir_refresh(self):
                 if repo not in self.repos:
                     self.repos.append(repo)
     self.lastrefresh = time.time()
-
-hgweb.hgwebdir_mod.hgwebdir.refresh = _hgwebdir_refresh
+extensions.wrapfunction(
+    hgweb.hgwebdir_mod.hgwebdir, 'refresh', _hgwebdir_refresh)
 
 
 def _nested_apply(ui, repo, function, status, *args, **kwargs):
@@ -181,6 +152,8 @@ def _nested_diff(ui, repo, *pats, **opts):
     cmdutil.diffordiffstat = diffordiffstat
 
 
+ at command('^ndiff', cmdutil.findcmd('diff', commands.table)[1][1],
+    _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'))
 def ndiff(ui, repo, *pats, **opts):
     '''diff nested repositories (or selected files)
 
@@ -190,6 +163,8 @@ def ndiff(ui, repo, *pats, **opts):
     _nested_apply(ui, repo, _nested_diff, False, *pats, **opts)
 
 
+ at command('^nclone', cmdutil.findcmd('clone', commands.table)[1][1],
+    _('[OPTION]... SOURCE [DEST]'), norepo=True)
 def nclone(ui, source, dest=None, **opts):
     '''make a copy of an existing repository and all nested repositories
 
@@ -224,6 +199,9 @@ def nclone(ui, source, dest=None, **opts):
         ui.status('\n')
 
 
+ at command('^nshare',
+    [('U', 'noupdate', None, _('do not create a working copy'))],
+    _('[-U] SOURCE [DEST]'), norepo=True)
 def nshare(ui, source, dest=None, noupdate=False):
     '''create a new shared repository and all nested repositories
     '''
@@ -247,6 +225,8 @@ def nshare(ui, source, dest=None, noupdate=False):
         ui.status('\n')
 
 
+ at command('nincoming|nin', cmdutil.findcmd('incoming', commands.table)[1][1],
+    _('[-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]'))
 def nincoming(ui, repo, dest=None, **opts):
     '''show changest not found in repository and all nested repositories
 
@@ -254,6 +234,8 @@ def nincoming(ui, repo, dest=None, **opts):
     _nested_apply(ui, repo, commands.incoming, True, dest=dest, **opts)
 
 
+ at command('noutgoing|nout', cmdutil.findcmd('outgoing', commands.table)[1][1],
+    _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]'))
 def noutgoing(ui, repo, dest=None, **opts):
     '''show changesest not found in the destination and all nested repositories
 
@@ -261,6 +243,8 @@ def noutgoing(ui, repo, dest=None, **opts):
     _nested_apply(ui, repo, commands.outgoing, True, dest=dest, **opts)
 
 
+ at command('npull', cmdutil.findcmd('pull', commands.table)[1][1],
+    _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]'))
 def npull(ui, repo, source="default", **opts):
     '''pull changes from the specified source and all nested repositories
 
@@ -287,6 +271,8 @@ def npull(ui, repo, source="default", **opts):
     _nested_apply(ui, repo, commands.pull, True, source=source, **opts)
 
 
+ at command('^npush', cmdutil.findcmd('push', commands.table)[1][1],
+    _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'))
 def npush(ui, repo, dest=None, **opts):
     '''push changes to the specified destination and all nested repositories
 
@@ -311,6 +297,8 @@ def npush(ui, repo, dest=None, **opts):
     _nested_apply(ui, repo, commands.push, True, dest=dest, **opts)
 
 
+ at command('^nstatus|nst', cmdutil.findcmd('status', commands.table)[1][1],
+    _('[OPTION]... [FILE]...'))
 def nstatus(ui, repo, *pats, **opts):
     '''show changed files in the working directory and all nested repositories
 
@@ -320,6 +308,8 @@ def nstatus(ui, repo, *pats, **opts):
     _nested_apply(ui, repo, commands.status, True, *pats, **opts)
 
 
+ at command('^nupdate|nup', cmdutil.findcmd('update', commands.table)[1][1],
+    _('[-c] [-C] [-d DATE] [[-r] REV]'))
 def nupdate(ui, repo, node=None, rev=None, clean=False, date=None, check=False,
         **opts):
     '''update working directory and all nested repositories
@@ -345,34 +335,3 @@ def nupdate(ui, repo, node=None, rev=None, clean=False, date=None, check=False,
             check=check)
     _nested_apply(ui, repo, commands.update, True, node=node, rev=rev,
             clean=clean, date=date, check=check)
-
-cmdtable = {
-    '^ndiff': (ndiff,
-        cmdutil.findcmd('diff', commands.table)[1][1],
-        _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...')),
-    '^nclone': (nclone,
-        cmdutil.findcmd('clone', commands.table)[1][1],
-        _('[OPTION]... SOURCE [DEST]')),
-    '^nshare': (nshare,
-        [('U', 'noupdate', None, _('do not create a working copy'))],
-        ('[-U] SOURCE [DEST]')),
-    'nincoming|nin': (nincoming,
-        cmdutil.findcmd('incoming', commands.table)[1][1],
-        _('[-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]')),
-    'noutgoing|nout': (noutgoing,
-        cmdutil.findcmd('outgoing', commands.table)[1][1],
-        _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
-    'npull': (npull,
-        cmdutil.findcmd('pull', commands.table)[1][1],
-        _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')),
-    '^npush': (npush,
-        cmdutil.findcmd('push', commands.table)[1][1],
-        _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')),
-    '^nstatus|nst': (nstatus,
-        cmdutil.findcmd('status', commands.table)[1][1],
-        _('[OPTION]... [FILE]...')),
-    '^nupdate|nup': (nupdate,
-        cmdutil.findcmd('update', commands.table)[1][1],
-        _('[-c] [-C] [-d DATE] [[-r] REV]')),
-}
-commands.norepo += " nclone nshare"
diff --git a/setup.py b/setup.py
index a7dc1e2..bd32a85 100644
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
 setup(name='hgnested',
-    version='0.7',
+    version='0.8',
     author='B2CK',
     author_email='info at b2ck.com',
     url="http://bitbucket.org/cedk/hgnested",
@@ -29,6 +29,6 @@ setup(name='hgnested',
         ],
     license='GPL-3',
     install_requires=[
-        'Mercurial >= 2.9.0',
+        'Mercurial >= 3.6.0',
         ],
     )
-- 
hgnested



More information about the tryton-debian-vcs mailing list