Commit e625b149 authored by Javier Merino Cacho's avatar Javier Merino Cacho

Upstream version 1.8.5

parent a4d4413a
repo: f2636cfed11500fdc47d1e3822d8e4a2bd636bf7
node: 759cafce6becef077fb1a152b554a05ff66b04cd
node: bd979667611d9df733c61251e7668899f3e77a8f
branch: stable
tag: 1.8.3
tag: 1.8.5
......@@ -17,3 +17,5 @@ d0f3a5c2cb56ce65d9ef1c611c8bfbebdc3bef34 1.5.1
c1756971f8828a59c859513f208c6d79bf34c275 1.8
dde1ade36a49d3d0e1b4b8bd384a6797665b5081 1.8.1
38be7a6b6def3298fe9ffff141eb58e1370a53cc 1.8.2
759cafce6becef077fb1a152b554a05ff66b04cd 1.8.3
89997a5fc18163c5f65b83272b4521cdbf29984e 1.8.4
......@@ -15,7 +15,7 @@ details.
For more information and instructions, see :hg:`help subversion`.
'''
testedwith = '2.8.2 3.0.1 3.1 3.2.2 3.3'
testedwith = '2.8.2 3.0.1 3.1 3.2.2 3.3 3.4 3.5 3.6 3.7'
import os
import sys
......@@ -159,7 +159,8 @@ 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)
......
......@@ -630,6 +630,11 @@ def branches_in_paths(meta, tbdelta, paths, revnum, checkpath, listdir,
return branches
def convert_rev(ui, meta, svn, r, tbdelta, firstrun):
if svnwrap.subversion_version >= (1, 9, 0):
raise hgutil.Abort(
"hgsubversion doesn't support stupid mode with Subversion 1.9."
' Please email hgsubversion@googlegroups.com and let us know you'
' saw this, otherwise we may remove stupid mode entirely.')
# this server fails at replay
if meta.filemap:
......
......@@ -22,19 +22,19 @@ try:
from svn import delta
from svn import ra
current_bindings = (core.SVN_VER_MAJOR, core.SVN_VER_MINOR,
core.SVN_VER_MICRO)
subversion_version = (core.SVN_VER_MAJOR, core.SVN_VER_MINOR,
core.SVN_VER_MICRO)
except ImportError:
raise ImportError('Subversion %d.%d.%d or later required, '
'but no bindings were found' % required_bindings)
if current_bindings < required_bindings: # pragma: no cover
if subversion_version < required_bindings: # pragma: no cover
raise ImportError('Subversion %d.%d.%d or later required, '
'but bindings for %d.%d.%d found' %
(required_bindings + current_bindings))
(required_bindings + subversion_version))
def version():
return '%d.%d.%d' % current_bindings, 'SWIG'
return '%d.%d.%d' % subversion_version, 'SWIG'
# exported values
ERR_FS_ALREADY_EXISTS = core.SVN_ERR_FS_ALREADY_EXISTS
......
......@@ -215,7 +215,7 @@ def push(repo, dest, force, revs):
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()
......@@ -369,7 +369,7 @@ def push(repo, dest, force, revs):
return 1 # so we get a sane exit status, see hg's commands.push
def exchangepush(orig, repo, remote, force=False, revs=None, newbranch=False,
bookmarks=()):
bookmarks=(), **kwargs):
capable = getattr(remote, 'capable', lambda x: False)
if capable('subversion'):
pushop = exchange.pushoperation(repo, remote, force, revs, newbranch,
......@@ -377,7 +377,8 @@ def exchangepush(orig, repo, remote, force=False, revs=None, newbranch=False,
pushop.cgresult = push(repo, remote, force, revs)
return pushop
else:
return orig(repo, remote, force, revs, newbranch, bookmarks=bookmarks)
return orig(repo, remote, force, revs, newbranch, bookmarks=bookmarks,
**kwargs)
def pull(repo, source, heads=[], force=False, meta=None):
"""pull new revisions from Subversion"""
......@@ -516,7 +517,7 @@ def pull(repo, source, heads=[], force=False, meta=None):
ui.status("pulled %d revisions\n" % revisions)
def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=(),
opargs=None):
**kwargs):
capable = getattr(remote, 'capable', lambda x: False)
if capable('subversion'):
# transaction manager is present in Mercurial >= 3.3
......@@ -537,13 +538,7 @@ def exchangepull(orig, repo, remote, heads=None, force=False, bookmarks=(),
else:
pullop.releasetransaction()
else:
if opargs is not None:
# hg 3.5
return orig(
repo, remote, heads, force, bookmarks=bookmarks, opargs=opargs)
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
......
......@@ -14,6 +14,7 @@ except ImportError:
import test_util
from hgsubversion import wrappers
from hgsubversion import svnwrap
def _do_case(self, name, stupid):
......@@ -55,7 +56,8 @@ attrs = {'_do_case': _do_case,
for case in test_util.custom:
name = 'test_' + case[:-len('.svndump')].replace('-', '_')
attrs[name] = buildmethod(case, name, stupid=False)
name += '_stupid'
attrs[name] = buildmethod(case, name, stupid=True)
if svnwrap.subversion_version < (1, 9, 0):
name += '_stupid'
attrs[name] = buildmethod(case, name, stupid=True)
CustomPullTests = type('CustomPullTests', (test_util.TestBase,), attrs)
......@@ -14,6 +14,7 @@ except ImportError:
import test_util
from hgsubversion import wrappers
from hgsubversion import svnwrap
def _do_case(self, name, layout):
......@@ -48,18 +49,20 @@ def buildmethod(case, name, layout):
m.__doc__ = 'Test stupid produces same as real on %s. (%s)' % (case, layout)
return m
attrs = {'_do_case': _do_case,
}
for case in (f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')):
if case == 'corrupt.svndump':
continue
name = 'test_' + case[:-len('.svndump')].replace('-', '_')
# Automatic layout branchtag collision exposes a minor defect
# here, but since it isn't a regression we suppress the test case.
if case != 'branchtagcollision.svndump':
attrs[name] = buildmethod(case, name, 'auto')
attrs[name + '_single'] = buildmethod(case, name + '_single', 'single')
if case in test_util.custom:
attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom')
if svnwrap.subversion_version < (1, 9, 0):
attrs = {'_do_case': _do_case,
}
for case in (f for f in os.listdir(test_util.FIXTURES)
if f.endswith('.svndump')):
if case == 'corrupt.svndump':
continue
name = 'test_' + case[:-len('.svndump')].replace('-', '_')
# Automatic layout branchtag collision exposes a minor defect
# here, but since it isn't a regression we suppress the test case.
if case != 'branchtagcollision.svndump':
attrs[name] = buildmethod(case, name, 'auto')
attrs[name + '_single'] = buildmethod(case, name + '_single', 'single')
if case in test_util.custom:
attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom')
StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs)
StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs)
......@@ -28,6 +28,7 @@ from mercurial import util as hgutil
from mercurial import extensions
from hgsubversion import compathacks
from hgsubversion import svnwrap
try:
from mercurial import obsolete
......@@ -358,8 +359,12 @@ def svnpropget(repo_path, path, prop, rev='HEAD'):
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()
......@@ -431,7 +436,7 @@ class TestMeta(type):
for origname in dir(cls):
_obsolete_wrap(cls, origname)
if cls.stupid_mode_tests:
if cls.stupid_mode_tests and svnwrap.subversion_version < (1, 9, 0):
for origname in dir(cls):
_stupid_wrap(cls, origname)
......@@ -761,7 +766,11 @@ files: {files}
"""
_ui.pushbuffer()
graphlog.graphlog(_ui, repo, rev=None, template=templ)
try:
graphlog.graphlog(_ui, repo, rev=None, template=templ)
except AttributeError:
from mercurial import commands
commands.log(_ui, repo, rev=None, template=templ, graph=True)
return _ui.popbuffer()
def draw(self, repo):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment