Rev 1837: Move fileprop revid detection to mapping. in file:///data/jelmer/bzr-svn/trunk/
Jelmer Vernooij
jelmer at samba.org
Sat Sep 6 22:56:29 BST 2008
At file:///data/jelmer/bzr-svn/trunk/
------------------------------------------------------------
revno: 1837
revision-id: jelmer at samba.org-20080906215626-he1qb4gmccih8m4f
parent: jelmer at samba.org-20080906193359-o9096fh0mvo2wgvl
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2008-09-06 23:56:26 +0200
message:
Move fileprop revid detection to mapping.
modified:
mapping.py mapping.py-20080128201303-6cp01phc0dmc0kiv-1
revids.py revids.py-20070416220458-36vfa0730cchevp1-1
revmeta.py revmeta.py-20080901215045-n8a6arqybs9ez5hl-1
transport.py transport.py-20060406231150-b3472d06b3a0818d
=== modified file 'mapping.py'
--- a/mapping.py 2008-09-04 09:40:03 +0000
+++ b/mapping.py 2008-09-06 21:56:26 +0000
@@ -718,3 +718,17 @@
if k.startswith(SVN_PROP_BZR_PREFIX):
return 1
return 0
+
+
+def get_roundtrip_ancestor_revids(fileprops):
+ for propname, propvalue in fileprops.items():
+ if not propname.startswith(SVN_PROP_BZR_REVISION_ID):
+ continue
+ mapping_name = propname[len(SVN_PROP_BZR_REVISION_ID):]
+ for line in propvalue.splitlines():
+ try:
+ (revno, revid) = parse_revid_property(line)
+ except svn_errors.InvalidPropertyValue, ie:
+ mutter(str(ie))
+ yield (revid, revno, mapping_name)
+
=== modified file 'revids.py'
--- a/revids.py 2008-09-04 08:11:08 +0000
+++ b/revids.py 2008-09-06 21:56:26 +0000
@@ -83,17 +83,10 @@
revids = set()
try:
revmeta = self.repos._revmeta_provider.get_revision(branch, revno)
- for propname, propvalue in revmeta.get_fileprops().items():
- if not propname.startswith(SVN_PROP_BZR_REVISION_ID):
- continue
- mapping_name = propname[len(SVN_PROP_BZR_REVISION_ID):]
- for line in propvalue.splitlines():
- try:
- revids.add((parse_revid_property(line), mapping_name))
- except InvalidPropertyValue, ie:
- mutter(str(ie))
+ for revid, revno, mapping_name in revmeta.get_roundtrip_ancestor_revids():
+ revids.add(((revno, revid), mapping_name))
except SubversionException, (_, ERR_FS_NOT_DIRECTORY):
- continue
+ continue
# If there are any new entries that are not yet in the cache,
# add them
=== modified file 'revmeta.py'
--- a/revmeta.py 2008-09-06 13:34:47 +0000
+++ b/revmeta.py 2008-09-06 21:56:26 +0000
@@ -17,7 +17,7 @@
from bzrlib.revision import NULL_REVISION, Revision
from bzrlib.plugins.svn import changes, core, errors as svn_errors, logwalker, properties
-from bzrlib.plugins.svn.mapping import is_bzr_revision_fileprops, is_bzr_revision_revprops, estimate_bzr_ancestors, SVN_REVPROP_BZR_SIGNATURE
+from bzrlib.plugins.svn.mapping import is_bzr_revision_fileprops, is_bzr_revision_revprops, estimate_bzr_ancestors, SVN_REVPROP_BZR_SIGNATURE, get_roundtrip_ancestor_revids
from bzrlib.plugins.svn.svk import (SVN_PROP_SVK_MERGE, svk_features_merged_since,
parse_svk_feature, estimate_svk_ancestors)
@@ -265,6 +265,12 @@
def get_fileid_map(self, mapping):
return mapping.import_fileid_map(self.get_revprops(), self.get_changed_fileprops())
+ def get_roundtrip_ancestor_revids(self):
+ if self.metabranch is not None and not self.metabranch.consider_bzr_fileprops(self):
+ # This revisions descendant doesn't have bzr fileprops set, so this one can't have them either.
+ return 0
+ return iter(get_roundtrip_ancestor_revids(self.get_fileprops()))
+
def __hash__(self):
return hash((self.__class__, self.uuid, self.branch_path, self.revnum))
=== modified file 'transport.py'
--- a/transport.py 2008-09-06 19:33:59 +0000
+++ b/transport.py 2008-09-06 21:56:26 +0000
@@ -28,7 +28,7 @@
from bzrlib.plugins.svn.auth import create_auth_baton
from bzrlib.plugins.svn.client import get_config
from bzrlib.plugins.svn.core import SubversionException
-from bzrlib.plugins.svn.errors import convert_svn_error, NoSvnRepositoryPresent, ERR_BAD_URL, ERR_RA_SVN_REPOS_NOT_FOUND, ERR_FS_ALREADY_EXISTS, ERR_FS_NOT_DIRECTORY, ERR_RA_DAV_RELOCATED, ERR_RA_DAV_PATH_NOT_FOUND
+from bzrlib.plugins.svn.errors import convert_svn_error, NoSvnRepositoryPresent, ERR_BAD_URL, ERR_RA_SVN_REPOS_NOT_FOUND, ERR_FS_ALREADY_EXISTS, ERR_FS_NOT_DIRECTORY, ERR_RA_DAV_RELOCATED, ERR_RA_DAV_PATH_NOT_FOUND, ERR_UNKNOWN_CAPABILITY
import urlparse
import urllib
@@ -408,6 +408,10 @@
try:
try:
self.capabilities[cap] = conn.has_capability(cap)
+ except SubversionException, (msg, num):
+ if num != ERR_UNKNOWN_CAPABILITY:
+ raise
+ self.capabilities[cap] = None
except NotImplementedError:
self.capabilities[cap] = None # None for unknown
return self.capabilities[cap]
More information about the bazaar-commits
mailing list