[Be-devel] OS X git dirname/path bug
Juozas Gaigalas
juozasgaigalas at gmail.com
Sat Jun 28 10:58:13 BST 2008
running
be set-root /Users/me/code/project
will produce a "" path not found error.
like this:
-----------------
File "/usr/local/bin/be", line 55, in <module>
sys.exit(execute(sys.argv[1], sys.argv[2:]))
File "/Library/Python/2.5/site-packages/libbe/cmdutil.py", line
105, in execute
return get_command(cmd).execute([a.decode(encoding) for a in args])
File "/Library/Python/2.5/site-packages/becommands/set_root.py",
line 57, in execute
bugdir.create_bug_dir(args[0], dir_rcs)
File "/Library/Python/2.5/site-packages/libbe/bugdir.py", line 110,
in create_bug_dir
set_version(root, rcs)
File "/Library/Python/2.5/site-packages/libbe/bugdir.py", line 70,
in set_version
rcs.set_file_contents(os.path.join(path, "version"),
TREE_VERSION_STRING)
File "/Library/Python/2.5/site-packages/libbe/git.py", line 52, in
set_file_contents
add_id(path)
File "/Library/Python/2.5/site-packages/libbe/git.py", line 39, in
add_id
invoke_client("add", filename, directory=git_repo_for_path('.'))
File "/Library/Python/2.5/site-packages/libbe/git.py", line 33, in
invoke_client
status,output,error = invoke(cl_args, expect, cwd=directory)
File "/Library/Python/2.5/site-packages/libbe/rcs.py", line 65, in
invoke
q = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, cwd=cwd)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/subprocess.py", line 593, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/subprocess.py", line 1079, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory: ' '
---------------------
doing:
cd /Users/me/code/project
be set-root .
produces a similar error (I can post it if people need it)
I was able to get be to work by modifying git.py like this:
def git_repo_for_path(path):
"""Find the root of the deepest repository containing path."""
# Assume that nothing funny is going on; in particular, that we
aren't
# dealing with a bare repo.
dirname = os.path.dirname(git_dir_for_path(path))
+ if dirname != "":
+ return dirname
+ else:
+ return "."
I hope this is helpful
More information about the Be-devel
mailing list