summaryrefslogtreecommitdiff
path: root/hgsubversion/svnrepo.py
diff options
context:
space:
mode:
Diffstat (limited to 'hgsubversion/svnrepo.py')
-rw-r--r--hgsubversion/svnrepo.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/hgsubversion/svnrepo.py b/hgsubversion/svnrepo.py
index 6bb3cd9..c471fa5 100644
--- a/hgsubversion/svnrepo.py
+++ b/hgsubversion/svnrepo.py
@@ -21,6 +21,13 @@ from mercurial import util as hgutil
from mercurial import httprepo
import mercurial.repo
+try:
+ from mercurial import phases
+ phases.public # defeat demand import
+except ImportError:
+ phases = None
+
+import re
import util
import wrappers
import svnwrap
@@ -76,7 +83,11 @@ def generate_repo_class(ui, repo):
class svnlocalrepo(superclass):
def svn_commitctx(self, ctx):
"""Commits a ctx, but defeats manifest recycling introduced in hg 1.9."""
- return self.commitctx(ctxctx(ctx))
+ hash = self.commitctx(ctxctx(ctx))
+ if phases is not None and getattr(self, 'pushkey', False):
+ # set phase to be public
+ self.pushkey('phases', self[hash].hex(), str(phases.draft), str(phases.public))
+ return hash
# TODO use newbranch to allow branch creation in Subversion?
@remotesvn
@@ -107,6 +118,14 @@ class svnremoterepo(mercurial.repo.repository):
raise hgutil.Abort('no Subversion URL specified')
self.path = path
self.capabilities = set(['lookup', 'subversion'])
+ pws = self.ui.config('hgsubversion', 'password_stores', None)
+ if pws is not None:
+ # Split pws at comas and strip neighbouring whitespace (whitespace
+ # at the beginning and end of pws has already been removed by the
+ # config parser).
+ self.password_stores = re.split(r'\s*,\s*', pws)
+ else:
+ self.password_stores = None
@propertycache
def svnauth(self):
@@ -127,7 +146,7 @@ class svnremoterepo(mercurial.repo.repository):
@propertycache
def svn(self):
try:
- return svnwrap.SubversionRepo(*self.svnauth)
+ return svnwrap.SubversionRepo(*self.svnauth, password_stores=self.password_stores)
except svnwrap.SubversionConnectionException, e:
self.ui.traceback()
raise hgutil.Abort(e)