Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1947)

Unified Diff: chrome/common/extensions/docs/server2/subversion_file_system.py

Issue 14759009: Docserver: fix SubversionFileSystem (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/subversion_file_system_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/subversion_file_system.py
diff --git a/chrome/common/extensions/docs/server2/subversion_file_system.py b/chrome/common/extensions/docs/server2/subversion_file_system.py
index 2d9db99c549f7b2603f6260a99b49491df7e0c75..b4f83d6dd10300b8d81d7f28d6ff6c8e5322d0b0 100644
--- a/chrome/common/extensions/docs/server2/subversion_file_system.py
+++ b/chrome/common/extensions/docs/server2/subversion_file_system.py
@@ -118,15 +118,17 @@ class SubversionFileSystem(FileSystem):
return StatInfo('0', {})
def Stat(self, path):
- directory = path.rsplit('/', 1)[0]
+ if '/' in path:
+ directory, filename = path.rsplit('/', 1)
Yoyo Zhou 2013/05/03 20:01:24 How about os.path.dirname and os.path.basename?
not at google - send to devlin 2013/05/03 20:41:25 Except these are URLs not paths, so needs to be ex
Yoyo Zhou 2013/05/03 20:52:47 The os.path functions seem to work just fine on UR
not at google - send to devlin 2013/05/03 21:06:49 did you test on windows?
+ else:
+ directory, filename = ('', path)
result = self._stat_fetcher.Fetch(directory + '/')
if result.status_code == 404:
raise FileNotFoundError(
'Got 404 when fetching %s from %s for Stat' % (path, directory))
stat_info = self._CreateStatInfo(result.content)
- if not path.endswith('/'):
- filename = path.rsplit('/', 1)[-1]
- if filename not in stat_info.child_versions:
- raise FileNotFoundError('%s was not in child versions' % filename)
- stat_info.version = stat_info.child_versions[filename]
- return stat_info
+ if path.endswith('/'):
+ return stat_info
+ if filename not in stat_info.child_versions:
+ raise FileNotFoundError('%s was not in child versions' % filename)
+ return StatInfo(stat_info.child_versions[filename])
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/subversion_file_system_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698