You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2012/09/19 20:43:27 UTC
[41/50] git commit: [#4793] ticket:162 Fix `Tree.get_obj_by_path()`
for absolute paths
[#4793] ticket:162 Fix `Tree.get_obj_by_path()` for absolute paths
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/bf372bbf
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/bf372bbf
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/bf372bbf
Branch: refs/heads/master
Commit: bf372bbf3ae155d7dcb3a38028c43bfe6f736e19
Parents: 51e9a8f
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Sep 6 15:34:24 2012 +0300
Committer: Dave Brondsema <db...@geek.net>
Committed: Fri Sep 7 14:11:43 2012 +0000
----------------------------------------------------------------------
Allura/allura/model/repo.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bf372bbf/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 1969eb5..ab37993 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -378,6 +378,8 @@ class Tree(RepoObject):
def get_obj_by_path(self, path):
if hasattr(path, 'get'):
path = path['new']
+ if path.startswith('/'):
+ path = path[1:]
path = path.split('/')
obj = self
for p in path: