Mateusz Kwapich | 9 Feb 02:26 2016

[PATCH] maps: remove python2.7ism from dynamic author mapping

# HG changeset patch
# User Mateusz Kwapich <mitrandir@...>
# Date 1454980639 28800
#      Mon Feb 08 17:17:19 2016 -0800
# Node ID abc87a62ff51efcc3f71ba835e08b2fdb3f30b3c
# Parent  a17d8874a09937d7a5fe3efb986135e21906c8e0
maps: remove python2.7ism from dynamic author mapping

diff --git a/hgsubversion/maps.py b/hgsubversion/maps.py
--- a/hgsubversion/maps.py
+++ b/hgsubversion/maps.py
 <at>  <at>  -103,8 +103,14  <at>  <at>  class AuthorMap(dict):
         if search_author in self:
             result = self.super.__getitem__(search_author)
         elif self.meta.mapauthorscmd:
-            self[author] = result = subprocess.check_output (
-                self.meta.mapauthorscmd % author, shell = True).strip()
+            cmd = self.meta.mapauthorscmd % author
+            process = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+            output, err = process.communicate()
+            retcode = process.poll()
+            if retcode:
+                msg = 'map author command "%s" exited with error'
+                raise hgutil.Abort(msg % cmd)
+            self[author] = result = output.strip()
         if not result:
             if self.meta.defaultauthors:
                 self[author] = result = '%s%s' % (author, self.defaulthost)

--

-- 
(Continue reading)

Laurent Charignon | 7 Jan 17:00 2016

[PATCH] compat: fix use of repo.parents() to repo[None].parents()

# HG changeset patch
# User Laurent Charignon <lcharignon@...>
# Date 1452182377 28800
#      Thu Jan 07 07:59:37 2016 -0800
# Node ID ff0187df82ee33ed947d18b257e6c863e499c3bf
# Parent  5ddb35c310975392bbd1a0fdce7e03b362c5dfbb
compat: fix use of repo.parents() to repo[None].parents()

While using hgsubversion with the latest tip of core mercurial I saw this
warning:
(compatibility will be dropped after Mercurial-3.7, update your code.) at:
/usr/lib/python2.6/site-packages/hgsubversion/wrappers.py:219 (push)
searching for changes
This patch fixes the issue and replaced the use of repo.parents() by
repo[None].parents().

diff --git a/hgsubversion/wrappers.py b/hgsubversion/wrappers.py
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
 <at>  <at>  -216,7 +216,7  <at>  <at> 
         if len(repo.parents()) != 1:
             ui.status('Cowardly refusing to push branch merge\n')
             return 0 # results in nonzero exit status, see hg's commands.py
-        workingrev = repo.parents()[0]
+        workingrev = repo[None].parents()[0]
         workingbranch = workingrev.branch()
         ui.status('searching for changes\n')
         hashes = meta.revmap.hashes()

--

-- 
(Continue reading)

Augie Fackler | 7 Jan 06:31 2016

Re: Test failures on Fedora Rawhide


> On Jan 6, 2016, at 11:23 PM, Dave Johansen <davejohansen@...> wrote:
> 
> The physical Fedora 23 machine that I have access to has 2x the RAM, so it doesn't run out of memory in mock
with just a normal build.
> 
> I just did some more tests in mock on the original machine and here are the results:
> Fedora 22: ~3.5% of memory and outputs "Ran 362 tests in 420.870s"
> Fedora 23: ~10.9% of memory and outputs "Ran 224 tests in 257.034s"
> Fedora Rawhide (24): ~11.1% of memory and outputs "Ran 224 tests in 267.253s" (it actually passed without
failures this time)
> 
> The memory usage and number of tests is similar on CentOS 7 to that of Fedora 22, so basically the tests are
using a fairly large chunk of memory in all cases but something about Fedora 23, subversion 1.9 and/or
mercurial 3.5 is causing a ~3x increase in the amount of memory used during the tests.
> 
> I ran each of the tests individually through time to see what the resident memory usage was but none of them
jumped out as a major offender, so it must be some sort of cumulative effect from running all of the tests
that's causing the problem. Any recommendations on further tests I can do to isolate the source of the issue?

Progress!

The first thing I’d try is checking Subversion 1.8 against Subversion 1.9 and see if that’s the root
cause. If that doesn’t change things, then I’d try latest hgsubversion with hg 3.5 on Fedora 22 and see
if that’s the problem.[0]

BTW, how much does 11% of memory mean? I’ve noticed the tests are distressingly slow on my Ubuntu
workstation, but hadn’t ever tried to diagnose. I suppose it could be a swapping problem there.

Thanks for sticking with this. It’s been quite a mess.
(Continue reading)

Augie Fackler | 6 Jan 17:20 2016

Re: Test failures on Fedora Rawhide


On Jan 6, 2016, at 11:14 AM, Dave Johansen <davejohansen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Yes, I have a physical Fedora 23 machine at my home and I can do some testing tonight. What would you recommend I do to test this?

For starters, run the testsuite without Mock in operation, and see if the error persists. If it does, we’re probably going to need to deploy some sort of memory analysis tool to figure out why it’s using a sinful amount of memory on Fedora 23.

--
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to hgsubversion-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at https://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Sean Farley | 30 Oct 03:10 2015
Gravatar

[PATCH 1 of 2 svn1.9-need-halp] tests: update for behavior change in subversion 1.9

# HG changeset patch
# User Sean Farley <sean@...>
# Date 1446164321 25200
#      Thu Oct 29 17:18:41 2015 -0700
# Node ID d7e60946c2d62b672d7f1b2db920f6bee1c3d0c8
# Parent  a279eb7185d4815781293ecfd31cb1e0cdbbc836
tests: update for behavior change in subversion 1.9

In revision r1592724, subversion changed 'svn propget' when no properties are
there to be an error. This is mildly annoying but oh well. We work around this
to achieve the old behavior.

I pity the scripts that relied on that behavior.

diff --git a/tests/test_util.py b/tests/test_util.py
--- a/tests/test_util.py
+++ b/tests/test_util.py
 <at>  <at>  -356,12 +356,16  <at>  <at>  def svnpropget(repo_path, path, prop, re
     args = ['svn', 'propget', '-r', str(rev), prop, path]
     p = subprocess.Popen(args,
                          stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT)
     stdout, stderr = p.communicate()
-    if p.returncode:
+    if p.returncode and stderr:
         raise Exception('svn ls failed on %s: %r' % (path, stderr))
+    if 'W200017' in stdout:
+        # subversion >= 1.9 changed 'no properties' to be an error, so let's
+        # avoid that
+        return ''
     return stdout.strip()

 
 def _obsolete_wrap(cls, name):
     origfunc = getattr(cls, name)

--

-- 
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe@...
To post to this group, send email to hgsubversion@...
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Sean Farley | 21 Oct 00:49 2015
Gravatar

[PATCH 1 of 2] wrappers: accept-and-forward kwargs including opargs

# HG changeset patch
# User Sean Farley <sean@...>
# Date 1444944592 25200
#      Thu Oct 15 14:29:52 2015 -0700
# Node ID 0466f6b75b238162381eec0e3f278107195de0b3
# Parent  72d5a2449bf51cf8b05c9ce283413cd1da8062e3
wrappers: accept-and-forward kwargs including opargs

We didn't really need opargs, so let's remove the conditional and just forward
it.

diff --git a/hgsubversion/wrappers.py b/hgsubversion/wrappers.py
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
 <at>  <at>  -521,11 +521,11  <at>  <at>  def pull(repo, source, heads=[], force=F
         return 0
     else:
         ui.status("pulled %d revisions\n" % revisions)

 def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=(),
-                 opargs=None, **kwargs):
+                 **kwargs):
     capable = getattr(remote, 'capable', lambda x: False)
     if capable('subversion'):
         # transaction manager is present in Mercurial >= 3.3
         try:
             trmanager = getattr(exchange, 'transactionmanager')
 <at>  <at>  -542,18 +542,11  <at>  <at>  def exchangepull(orig, repo, remote, hea
             if trmanager:
                 pullop.trmanager.release()
             else:
                 pullop.releasetransaction()
     else:
-        if opargs is not None:
-            # hg 3.5
-            return orig(
-                repo, remote, heads, force, bookmarks=bookmarks,
-                opargs=opargs, **kwargs)
-        else:
-            # hg 3.4
-            return orig(repo, remote, heads, force, bookmarks=bookmarks)
+        return orig(repo, remote, heads, force, bookmarks=bookmarks, **kwargs)

 def rebase(orig, ui, repo, **opts):
     """rebase current unpushed revisions onto the Subversion head

     This moves a line of development from making its own head to the top of

--

-- 
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe@...
To post to this group, send email to hgsubversion@...
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Yuya Nishihara | 30 Sep 16:27 2015
Gravatar

[PATCH] help: ignore argument passed to doc loader

# HG changeset patch
# User Yuya Nishihara <yuya@...>
# Date 1443618767 -32400
#      Wed Sep 30 22:12:47 2015 +0900
# Node ID 327038b32b4d55171ced8e03d96125a5ad84dcee
# Parent  30193fdd5da4ef5ec218a4b782347823a4f575ac
help: ignore argument passed to doc loader

The API changed at Mercurial e0c572d4d112.

diff --git a/hgsubversion/__init__.py b/hgsubversion/__init__.py
--- a/hgsubversion/__init__.py
+++ b/hgsubversion/__init__.py
 <at>  <at>  -159,7 +159,8  <at>  <at>  def extsetup(ui):
     entries = (
         (['subversion'],
          "Working with Subversion Repositories",
-         lambda: open(os.path.join(helpdir, 'subversion.rst')).read()),
+         # Mercurial >= 3.6: doc(ui)
+         lambda *args: open(os.path.join(helpdir, 'subversion.rst')).read()),
     )

     help.helptable.extend(entries)

--

-- 
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe@...
To post to this group, send email to hgsubversion@...
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Sean Farley | 29 Sep 20:04 2015
Gravatar

[PATCH 1 of 4 allow-empty-branch-map V2] subvertpy_wrapper: remove meta attribute

# HG changeset patch
# User Sean Farley <sean@...>
# Date 1443549639 25200
#      Tue Sep 29 11:00:39 2015 -0700
# Node ID 26b42c59e9cd371c6e87f73ddc49203c28e90655
# Parent  538bbb92760931de8eaaaab0fc19cf96935fbbbd
subvertpy_wrapper: remove meta attribute

Apparently, I used this in a previous attempt to implement filtering out
branches but this got left over in a refactor.

diff --git a/hgsubversion/svnwrap/subvertpy_wrapper.py b/hgsubversion/svnwrap/subvertpy_wrapper.py
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py
 <at>  <at>  -185,11 +185,11  <at>  <at>  class SubversionRepo(object):

     Note that password stores do not work, the parameter is only here
     to ensure that the API is the same as for the SWIG wrapper.
     """
     def __init__(self, url='', username='', password='', head=None,
-                 password_stores=None, meta=None):
+                 password_stores=None):
         parsed = common.parse_url(url, username, password)
         # --username and --password override URL credentials
         self.username = parsed[0]
         self.password = parsed[1]
         self.svn_url = parsed[2]
 <at>  <at>  -209,13 +209,10  <at>  <at>  class SubversionRepo(object):
         # expects unquoted paths
         self.subdir = urllib.unquote(self.subdir)
         self.hasdiff3 = True
         self.autoprops_config = common.AutoPropsConfig()

-        # store the svn meta object for use with branch skipping
-        self.meta = meta
-
     def init_ra_and_client(self):
         """
         Initializes the RA and client layers.

         With the SWIG bindings, getting unified diffs runs the remote server

--

-- 
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe@...
To post to this group, send email to hgsubversion@...
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Sean Farley | 28 Sep 03:33 2015
Gravatar

[PATCH 1 of 4 allow-empty-branch-map] svnmeta: add method to determine whether we will skip a particular branch

# HG changeset patch
# User Sean Farley <sean.michael.farley@...>
# Date 1395678057 18000
#      Mon Mar 24 11:20:57 2014 -0500
# Node ID 758424465f72a046e59b0a471e111dbaeb97db7e
# Parent  538bbb92760931de8eaaaab0fc19cf96935fbbbd
svnmeta: add method to determine whether we will skip a particular branch

diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
 <at>  <at>  -388,10 +388,23  <at>  <at>  class SVNMeta(object):
             'path': path,
             'rev': revnum,
         }
         return extra

+    def skipbranch(self, name):
+        '''Returns whether or not we're skipping a branch.'''
+        # sometimes it's easier to pass the path instead of just the branch
+        # name, so we test for that here
+        if name:
+            bname = self.split_branch_path(name)
+            if bname != (None, None, None):
+                name = bname[1]
+
+        # if the mapped branch == '' and the original branch name == '' then we
+        # won't commit this branch
+        return name and not self.branchmap.get(name, True)
+
     def mapbranch(self, extra, close=False):
         if close:
             extra['close'] = 1
         mapped = self.branchmap.get(extra.get('branch', 'default'))
         if not self.usebranchnames or mapped == 'default':

--

-- 
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe@...
To post to this group, send email to hgsubversion@...
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Dave Johansen | 1 Sep 21:05 2015
Picon
Gravatar

Test failures on Fedora Rawhide

I'm working on packaging hgusbversion for Fedora and 1.8.2 builds and passes all of the tests on Fedora 22 but on Fedora Rawhide (will be 24 when released), there are a few test failures. What can I do to help diagnose what the problem is and come up with a fix?
Thanks,
Dave

The error output is as follows:
======================================================================
ERROR: test_updateexternals stupid (test_externals.TestFetchExternals)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 413, in wrapper
    origfunc(self, *args, **opts)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_externals.py", line 149, in test_updateexternals
    ['deps/project1'], repo, 2)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_externals.py", line 132, in checkdeps
    svnexternals.updateexternals(ui, [rev], repo)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/hgsubversion/svnexternals.py", line 311, in updateexternals
    updater.update(ext[0], ext[1], ext[2], ext[3])
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/hgsubversion/svnexternals.py", line 243, in update
    os.makedirs(cwd)
  File "/usr/lib64/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 20] Not a directory: '/tmp/tmp0oaLaisvnwrap_test/testrepo_wc/subdir/deps'

======================================================================
ERROR: test_push_single_dir (test_single_dir_push.TestSingleDirPush)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_single_dir_push.py", line 60, in test_push_single_dir
    'svn:mime-type'))
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 362, in svnpropget
    raise Exception('svn ls failed on %s: %r' % (path, stderr))
Exception: svn ls failed on file:///tmp/tmpuDhLcNsvnwrap_test/testrepo-1/adding_binary: None

======================================================================
ERROR: test_push_single_dir obsolete (test_single_dir_push.TestSingleDirPush)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 381, in wrapper
    origfunc(self, *args, **opts)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_single_dir_push.py", line 60, in test_push_single_dir
    'svn:mime-type'))
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 362, in svnpropget
    raise Exception('svn ls failed on %s: %r' % (path, stderr))
Exception: svn ls failed on file:///tmp/tmpcQH223svnwrap_test/testrepo-1/adding_binary: None

======================================================================
ERROR: test_push_single_dir obsolete stupid (test_single_dir_push.TestSingleDirPush)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 413, in wrapper
    origfunc(self, *args, **opts)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 381, in wrapper
    origfunc(self, *args, **opts)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_single_dir_push.py", line 60, in test_push_single_dir
    'svn:mime-type'))
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 362, in svnpropget
    raise Exception('svn ls failed on %s: %r' % (path, stderr))
Exception: svn ls failed on file:///tmp/tmpF57vWGsvnwrap_test/testrepo-1/adding_binary: None

======================================================================
ERROR: test_push_single_dir stupid (test_single_dir_push.TestSingleDirPush)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 413, in wrapper
    origfunc(self, *args, **opts)
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_single_dir_push.py", line 60, in test_push_single_dir
    'svn:mime-type'))
  File "/builddir/build/BUILD/durin42-hgsubversion-38be7a6b6def/tests/test_util.py", line 362, in svnpropget
    raise Exception('svn ls failed on %s: %r' % (path, stderr))
Exception: svn ls failed on file:///tmp/tmp0c4rPSsvnwrap_test/testrepo-1/adding_binary: None

--
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to hgsubversion-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.
Dave Johansen | 17 Aug 21:00 2015
Picon
Gravatar

Enabling on install?

I'm working on packaging hgsubversion for Fedora and RHEL/EPEL. The question came up if hgsubversion should be enabled by default when it's installed ( https://bugzilla.redhat.com/show_bug.cgi?id=1221459#c8 ) and if so what's the "right" way to do that.
So, what is the recommended way to handle that? For what it's worth, it appears that hggit takes the approach that it has to be manually enabled by the user.
Thanks, Dave

--
You received this message because you are subscribed to the Google Groups "hgsubversion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hgsubversion+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to hgsubversion-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/hgsubversion.
For more options, visit https://groups.google.com/d/optout.

Gmane