Using bzr with bzr repository
Alexey Shamrin
shamrin at gmail.com
Wed Nov 16 09:26:14 GMT 2005
Hello!
How do you use bzr to work with repository which has bzrlib directory?
If I run "bzr", current directory gets added to sys.path, making bzr
script to import bzrlib from the current directory. Trying to remove
all occurences of current dir in sys.path I put the following code in
the beginning of bzr script:
try:
while True:
sys.path.remove(os.getcwd())
except ValueError:
pass
But this doesn't fully work. For example, when I run "bzr check"
inside the directory bzr.win32 and press Ctrl-C, I get the following
in the log:
[ 2276] Wed 12:18:29.678 ERROR: interrupted
command: 'c:\\soft\\python\\scripts\\bzr' 'check'
pwd: u'C:\\work\\prog\\bzr\\bzr.win32'
error: exceptions.KeyboardInterrupt
Traceback (most recent call last):
File "c:\work\prog\bzr\bzr.dev\bzrlib\commands.py", line 531, in
run_bzr_catch_errors
File "c:\work\prog\bzr\bzr.dev\bzrlib\commands.py", line 506, in run_bzr
File "c:\work\prog\bzr\bzr.dev\bzrlib\commands.py", line 225, in run_argv
File "c:\work\prog\bzr\bzr.dev\bzrlib\builtins.py", line 1242, in run
File "C:\work\prog\bzr\bzr.win32\bzrlib\check.py", line 196, in check
checker.check()
File "C:\work\prog\bzr\bzr.win32\bzrlib\check.py", line 72, in check
self.check_one_rev(rev_id)
File "C:\work\prog\bzr\bzr.win32\bzrlib\check.py", line 168, in check_one_rev
self._check_revision_tree(rev_id)
File "C:\work\prog\bzr\bzr.win32\bzrlib\check.py", line 183, in
_check_revision_tree
ie.check(self, rev_id, inv, tree)
File "c:\work\prog\bzr\bzr.dev\bzrlib\inventory.py", line 297, in check
File "c:\work\prog\bzr\bzr.dev\bzrlib\inventory.py", line 485, in _check
File "C:\work\prog\bzr\bzr.win32\bzrlib\tree.py", line 148, in get_file_lines
weave = self.get_weave(file_id)
File "C:\work\prog\bzr\bzr.win32\bzrlib\tree.py", line 143, in get_weave
transactions.PassThroughTransaction())
File "C:\work\prog\bzr\bzr.win32\bzrlib\store\weave.py", line 80, in get_weave
w = read_weave(self._get(file_id))
File "C:\work\prog\bzr\bzr.win32\bzrlib\weavefile.py", line 96, in read_weave
return read_weave_v5(f)
File "C:\work\prog\bzr\bzr.win32\bzrlib\weavefile.py", line 124, in
read_weave_v5
w._names.append(name)
KeyboardInterrupt
Look at how it references *both* bzr.win32 and bzr.dev. What is more,
I don't have bzr.dev directory... :-/
--
Alexey
More information about the bazaar
mailing list