Rev 992: Fix more tests. in file:///data/jelmer/bzr-svn/layout/
Jelmer Vernooij
jelmer at samba.org
Fri May 2 21:24:18 BST 2008
At file:///data/jelmer/bzr-svn/layout/
------------------------------------------------------------
revno: 992
revision-id: jelmer at samba.org-20080502202401-bo2z83mdmz0yqmks
parent: jelmer at samba.org-20080502193600-gdwwchgznph0y37c
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: layout
timestamp: Fri 2008-05-02 22:24:01 +0200
message:
Fix more tests.
modified:
__init__.py __init__.py-20051008155114-eae558e6cf149e1d
config.py config.py-20070624185721-0j8f1ly75uo4s1lk-1
mapping.py mapping.py-20080128201303-6cp01phc0dmc0kiv-1
mapping3/__init__.py __init__.py-20080502174630-9324zh25kka98vlw-1
mapping3/scheme.py scheme.py-20060516195850-95181aae6b272f9e
repository.py repository.py-20060306123302-1f8c5069b3fe0265
revids.py revids.py-20070416220458-36vfa0730cchevp1-1
tree.py tree.py-20060624222557-dudlwqcmkf22lt2s-1
=== modified file '__init__.py'
--- a/__init__.py 2008-05-02 19:36:00 +0000
+++ b/__init__.py 2008-05-02 20:24:01 +0000
@@ -147,7 +147,7 @@
"""
if isinstance(schemename, unicode):
schemename = schemename.encode("ascii")
- from scheme import BranchingScheme
+ from mapping3.scheme import BranchingScheme
from bzrlib.errors import BzrCommandError
ret = BranchingScheme.find_scheme(schemename)
@@ -389,9 +389,9 @@
scheme = scheme_from_branch_list(
map(lambda x:x.strip("\n"), schemestr.splitlines()))
if repository_wide:
- repos.set_property_scheme(scheme)
+ set_property_scheme(repos, scheme)
else:
- repos.set_branching_scheme(scheme, mandatory=True)
+ set_config_scheme(repos, scheme, mandatory=True)
elif scheme is not None:
info(scheme_str(scheme))
=== modified file 'config.py'
--- a/config.py 2008-05-02 18:37:05 +0000
+++ b/config.py 2008-05-02 20:24:01 +0000
@@ -20,7 +20,6 @@
import os
-from mapping3.scheme import BranchingScheme
import svn.core
# Settings are stored by UUID.
@@ -63,6 +62,7 @@
:return: BranchingScheme instance.
"""
+ from mapping3.scheme import BranchingScheme
schemename = self._get_user_option("branching-scheme", use_global=False)
if schemename is not None:
return BranchingScheme.find_scheme(schemename.encode('ascii'))
=== modified file 'mapping.py'
--- a/mapping.py 2008-05-02 19:36:00 +0000
+++ b/mapping.py 2008-05-02 20:24:01 +0000
@@ -22,7 +22,6 @@
from bzrlib.plugins.svn import version_info
import calendar
import errors
-import sha
import svn
import time
import urllib
=== modified file 'mapping3/__init__.py'
--- a/mapping3/__init__.py 2008-05-02 19:36:00 +0000
+++ b/mapping3/__init__.py 2008-05-02 20:24:01 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005-2007 Jelmer Vernooij <jelmer at samba.org>
+# Copyright (C) 2005-2008 Jelmer Vernooij <jelmer at samba.org>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
from mapping3.scheme import (BranchingScheme, guess_scheme_from_branch_path,
guess_scheme_from_history, ListBranchingScheme,
parse_list_scheme_text)
+import sha
SVN_PROP_BZR_BRANCHING_SCHEME = 'bzr:branching-scheme'
@@ -201,19 +202,19 @@
self.fileprops = BzrSvnMappingv3FileProps(scheme)
def get_rhs_parents(self, branch_path, svn_revprops, fileprops):
- if svn_revprops.has_key(SVN_REVPROP_BZR_MAPPING_VERSION):
+ if svn_revprops.has_key(mapping.SVN_REVPROP_BZR_MAPPING_VERSION):
return self.revprops.get_rhs_parents(branch_path, svn_revprops, fileprops)
else:
return self.fileprops.get_rhs_parents(branch_path, svn_revprops, fileprops)
def get_revision_id(self, branch_path, revprops, fileprops):
- if revprops.has_key(SVN_REVPROP_BZR_MAPPING_VERSION):
+ if revprops.has_key(mapping.SVN_REVPROP_BZR_MAPPING_VERSION):
return self.revprops.get_revision_id(branch_path, revprops, fileprops)
else:
return self.fileprops.get_revision_id(branch_path, revprops, fileprops)
def import_fileid_map(self, svn_revprops, fileprops):
- if svn_revprops.has_key(SVN_REVPROP_BZR_MAPPING_VERSION):
+ if svn_revprops.has_key(mapping.SVN_REVPROP_BZR_MAPPING_VERSION):
return self.revprops.import_fileid_map(svn_revprops, fileprops)
else:
return self.fileprops.import_fileid_map(svn_revprops, fileprops)
=== modified file 'mapping3/scheme.py'
--- a/mapping3/scheme.py 2008-05-02 18:37:05 +0000
+++ b/mapping3/scheme.py 2008-05-02 20:24:01 +0000
@@ -46,6 +46,9 @@
"""
raise NotImplementedError
+ def parse(self, path):
+ return self.unprefix(path)
+
@staticmethod
def find_scheme(name):
"""Find a branching scheme by name.
=== modified file 'repository.py'
--- a/repository.py 2008-05-02 19:36:00 +0000
+++ b/repository.py 2008-05-02 20:24:01 +0000
@@ -115,6 +115,7 @@
self._cached_revnum = None
self._lock_mode = None
self._lock_count = 0
+ self._layout = None
self.transport = transport
self.uuid = transport.get_uuid()
assert self.uuid is not None
@@ -201,7 +202,12 @@
def _make_parents_provider(self):
return CachingParentsProvider(self)
+ def set_layout(self, layout):
+ self._layout = layout
+
def get_layout(self):
+ if self._layout is not None:
+ return self._layout
return self.get_mapping().scheme
def _warn_if_deprecated(self):
@@ -247,7 +253,7 @@
yielded_paths = set()
for p in paths:
try:
- bp = mapping.parse(p)[0]
+ bp = layout.parse(p)[0]
if not bp in yielded_paths:
if not paths.has_key(bp) or paths[bp][0] != 'D':
assert revnum > 0 or bp == ""
@@ -486,7 +492,7 @@
return self.get_revmap().get_revision_id(revnum, path, mapping, revprops, changed_fileprops)
- def lookup_revision_id(self, revid, layout=None):
+ def lookup_revision_id(self, revid, layout=None, ancestry=None):
"""Parse an existing Subversion-based revision id.
:param revid: The revision id.
@@ -495,6 +501,7 @@
:raises: NoSuchRevision
:return: Tuple with branch path, revision number and mapping.
"""
+ # FIXME: Use ancestry
# If there is no entry in the map, walk over all branches:
if layout is None:
layout = self.get_layout()
=== modified file 'revids.py'
--- a/revids.py 2008-05-02 18:48:10 +0000
+++ b/revids.py 2008-05-02 20:24:01 +0000
@@ -180,7 +180,7 @@
(branch_path, min_revnum, max_revnum, scheme) = self.cache.lookup_revid(revid)
assert isinstance(branch_path, str)
- return self.actual.bisect_revid_revnum(revid, branch_path, max_revnum, get_scheme(scheme))
+ return self.actual.bisect_revid_revnum(revid, branch_path, max_revnum)
class RevisionIdMapCache(CacheTable):
=== modified file 'tree.py'
--- a/tree.py 2008-03-29 15:47:25 +0000
+++ b/tree.py 2008-05-02 20:24:01 +0000
@@ -175,23 +175,10 @@
return file_id
def change_dir_prop(self, id, name, value, pool):
- from mapping import (SVN_PROP_BZR_ANCESTRY,
- SVN_PROP_BZR_PREFIX, SVN_PROP_BZR_REVISION_INFO,
- SVN_PROP_BZR_FILEIDS, SVN_PROP_BZR_REVISION_ID,
- SVN_PROP_BZR_BRANCHING_SCHEME, SVN_PROP_BZR_MERGE)
-
if name == svn.core.SVN_PROP_ENTRY_COMMITTED_REV:
self.dir_revnum[id] = int(value)
elif name == svn.core.SVN_PROP_IGNORE:
self.dir_ignores[id] = value
- elif name.startswith(SVN_PROP_BZR_ANCESTRY):
- if id != self.tree._inventory.root.file_id:
- mutter('%r set on non-root dir!' % name)
- return
- elif name in (SVN_PROP_BZR_FILEIDS, SVN_PROP_BZR_BRANCHING_SCHEME):
- if id != self.tree._inventory.root.file_id:
- mutter('%r set on non-root dir!' % name)
- return
elif name in (svn.core.SVN_PROP_ENTRY_COMMITTED_DATE,
svn.core.SVN_PROP_ENTRY_LAST_AUTHOR,
svn.core.SVN_PROP_ENTRY_LOCK_TOKEN,
@@ -200,18 +187,10 @@
pass
elif name.startswith(svn.core.SVN_PROP_WC_PREFIX):
pass
- elif (name == SVN_PROP_BZR_REVISION_INFO or
- name.startswith(SVN_PROP_BZR_REVISION_ID)):
- pass
- elif name == SVN_PROP_BZR_MERGE:
- pass
- elif (name.startswith(svn.core.SVN_PROP_PREFIX) or
- name.startswith(SVN_PROP_BZR_PREFIX)):
+ elif name.startswith(svn.core.SVN_PROP_PREFIX):
mutter('unsupported dir property %r' % name)
def change_file_prop(self, id, name, value, pool):
- from mapping import SVN_PROP_BZR_PREFIX
-
if name == svn.core.SVN_PROP_EXECUTABLE:
self.is_executable = (value != None)
elif name == svn.core.SVN_PROP_SPECIAL:
@@ -228,8 +207,7 @@
pass
elif name.startswith(svn.core.SVN_PROP_WC_PREFIX):
pass
- elif (name.startswith(svn.core.SVN_PROP_PREFIX) or
- name.startswith(SVN_PROP_BZR_PREFIX)):
+ elif name.startswith(svn.core.SVN_PROP_PREFIX):
mutter('unsupported file property %r' % name)
def add_file(self, path, parent_id, copyfrom_path, copyfrom_revnum, baton):
More information about the bazaar-commits
mailing list