# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-from bzrlib.branch import Branch, BranchFormat
+from bzrlib.branch import Branch, BranchFormat, BranchCheckResult
from bzrlib.errors import NotBranchError, NoWorkingTree, NoSuchRevision, \
NoSuchFile
from bzrlib.inventory import Inventory, InventoryFile, InventoryDirectory, \
self.base = "%s/%s" % (repos.url, branch_path)
self._format = SvnBranchFormat()
mutter("Connected to branch at %s" % branch_path)
+
+ def check(self):
+ return BranchCheckResult(self)
def path_from_file_id(self, revision_id, file_id):
"""Generate a full Subversion path from a bzr file id.
return self.base+"/"+self.filename_from_file_id(revision_id, file_id)
def _generate_revnum_map(self):
- #FIXME: Revids should be globally unique, so we should include the
- # branch path somehow. If we don't do this there might be revisions
- # that have the same id because they were created in the same commit.
self._revision_history = []
def rcvr(paths, rev, author, date, message, pool):
raise NotImplementedError(self.get_transaction)
def append_revision(self, *revision_ids):
- raise NotImplementedError(self.append_revision)
+ # FIXME: raise NotImplementedError(self.append_revision)
+ pass
def get_physical_lock_status(self):
return False
"""See Branch.get_format_description."""
return 'Subversion Smart Server'
+ def get_format_string(self):
+ return 'Subversion Smart Server'
+
def initialize(self, to_bzrdir):
raise NotImplementedError(self.initialize)
def __init__(self, repository, branch, parents, config, revprops):
super(SvnCommitBuilder, self).__init__(repository, parents,
config, None, None, None, revprops, None)
+ self.branch = branch
+
+ # TODO: Allow revision id to be specified, but only if it
+ # matches the format for Subversion revision ids, the UUID
+ # matches and the revnum is in the future. Set the
+ # revision num on the delta editor using set_target_revision
def _generate_revision_if_needed(self):
pass
- @staticmethod
- def done(info, pool):
- if not info.post_commit_err is None:
- raise BzrError(info.post_commit_err)
-
- self.revnum = info.revnum
-
def set_message(self, message):
- self.editor, self.editor_baton = svn.ra.get_commit_editor2(
- self.repository.ra, message, self.done, None, False)
+ self.message = message
def finish_inventory(self):
# Subversion doesn't have an inventory
pass
def commit(self):
- root = svn.delta.editor_invoke_open_root(self.editor, self.editor_baton, 4)
+ def done(info, pool):
+ if not info.post_commit_err is None:
+ raise BzrError(info.post_commit_err)
+
+ self.revnum = info.revision
+
+ editor, editor_baton = svn.ra.get_commit_editor2(
+ self.repository.ra, self.message, done, None, False)
+
+ root = svn.delta.editor_invoke_open_root(editor, editor_baton, 4)
+
+ svn.delta.editor_invoke_close_edit(editor, editor_baton)
- svn.delta.editor_invoke_close_edit(self.editor, self.editor_baton)
+ # Throw away the cache of revision ids
+ self.branch._generate_revnum_map()
return self.repository.generate_revision_id(self.revnum,
- branch.branch_path)
+ self.branch.branch_path)
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+from bzrlib.branch import BranchCheckResult
from bzrlib.repository import Repository
from bzrlib.lockable_files import LockableFiles, TransportLock
from bzrlib.trace import mutter
self.ra = bzrdir.transport.ra
self.uuid = svn.ra.get_uuid(self.ra)
- self.url = url
+ self.base = self.url = url
self.fileid_map = {}
self.text_cache = {}
self.dir_cache = {}
def __del__(self):
svn.core.svn_pool_destroy(self.pool)
+ def check(self, revision_ids):
+ if not revision_ids:
+ raise ValueError("revision_ids must be non-empty in %s.check"
+ % (self,))
+ return BranchCheckResult(self)
+
def get_inventory(self, revision_id):
(path, revnum) = self.parse_revision_id(revision_id)
mutter('getting inventory %r for branch %r' % (revnum, path))