changeset 1378:e1619c051788

Merge with stable.
author Augie Fackler <raf@durin42.com>
date Fri, 04 Mar 2016 14:33:02 -0500
parents abc87a62ff51 (current diff) 2ae4fb5bfab9 (diff)
children 367e65989b41
files hgsubversion/wrappers.py
diffstat 4 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/__init__.py
+++ b/hgsubversion/__init__.py
@@ -195,7 +195,8 @@ hg.schemes.update({ 'file': _lookup, 'ht
                     'svn': svnrepo, 'svn+ssh': svnrepo, 'svn+http': svnrepo,
                     'svn+https': svnrepo})
 
-commands.optionalrepo += ' svn'
+if hgutil.safehasattr(commands, 'optionalrepo'):
+    commands.optionalrepo += ' svn'
 
 cmdtable = {
     "svn":
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -490,6 +490,9 @@ def svn(ui, repo, subcommand, *args, **o
         else:
             raise
 
+svn.optionalrepo=True
+svn.norepo = False
+
 table = {
     'genignore': genignore,
     'info': info,
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -72,7 +72,7 @@ def gcdisable(orig):
 def parentrev(ui, repo, meta, hashes):
     """Find the svn parent revision of the repo's dirstate.
     """
-    workingctx = repo.parents()[0]
+    workingctx = repo[None].parents()[0]
     outrev = outgoing_revisions(repo, hashes, workingctx.node())
     if outrev:
         workingctx = repo[outrev[-1]].parents()[0]
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -128,7 +128,7 @@ def findcommonoutgoing(repo, other, only
     # split off #rev; TODO implement --revision/#rev support
     svn = other.svn
     meta = repo.svnmeta(svn.uuid, svn.subdir)
-    parent = repo.parents()[0].node()
+    parent = repo[None].parents()[0].node()
     hashes = meta.revmap.hashes()
     common, heads = util.outgoing_common_and_heads(repo, hashes, parent)
     outobj = getattr(discovery, 'outgoing', None)
@@ -147,7 +147,7 @@ def findoutgoing(repo, dest=None, heads=
     # svnurl, revs, checkout = util.parseurl(dest.svnurl, heads)
     svn = dest.svn
     meta = repo.svnmeta(svn.uuid, svn.subdir)
-    parent = repo.parents()[0].node()
+    parent = repo[None].parents()[0].node()
     hashes = meta.revmap.hashes()
     return util.outgoing_revisions(repo, hashes, parent)
 
@@ -160,7 +160,7 @@ def diff(orig, ui, repo, *args, **opts):
     meta = repo.svnmeta()
     hashes = meta.revmap.hashes()
     if not opts.get('rev', None):
-        parent = repo.parents()[0]
+        parent = repo[None].parents()[0]
         o_r = util.outgoing_revisions(repo, hashes, parent.node())
         if o_r:
             parent = repo[o_r[-1]].parents()[0]
@@ -213,7 +213,7 @@ def push(repo, dest, force, revs):
 
         # Strategy:
         # 1. Find all outgoing commits from this head
-        if len(repo.parents()) != 1:
+        if len(repo[None].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[None].parents()[0]
@@ -564,7 +564,7 @@ def rebase(orig, ui, repo, **opts):
         """
         extra['branch'] = ctx.branch()
     extrafn = opts.get('svnextrafn', extrafn2)
-    sourcerev = opts.get('svnsourcerev', repo.parents()[0].node())
+    sourcerev = opts.get('svnsourcerev', repo[None].parents()[0].node())
     meta = repo.svnmeta()
     hashes = meta.revmap.hashes()
     o_r = util.outgoing_revisions(repo, hashes, sourcerev=sourcerev)