from bzrlib.branch import Branch
from bzrlib.errors import NotBranchError
from bzrlib import urlutils, osutils
from bzrlib.branch import Branch
from bzrlib.errors import NotBranchError
from bzrlib import urlutils, osutils
+ # Symlinks in ccan contain .., and bzr refuses to serve that. Simplify.
+ def squish(self, linkname):
+ result = []
+ for elem in string.split(linkname, os.sep):
+ if elem == '..':
+ result = result[:-1]
+ else:
+ result.append(elem)
+ return string.join(result, os.sep)
+
def list_branch_directory(self, branch, path, relpath):
tree = branch.basis_tree()
file_id = tree.path2id(relpath)
ie = tree.inventory[file_id]
if ie.kind == 'file':
return self.view_branch_file(tree, ie)
def list_branch_directory(self, branch, path, relpath):
tree = branch.basis_tree()
file_id = tree.path2id(relpath)
ie = tree.inventory[file_id]
if ie.kind == 'file':
return self.view_branch_file(tree, ie)