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

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: posixpath 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..676d77a659ca0fc1ea3fd5496b875014770eb04d 100644
--- a/chrome/common/extensions/docs/server2/subversion_file_system.py
+++ b/chrome/common/extensions/docs/server2/subversion_file_system.py
@@ -6,6 +6,7 @@ from file_system import FileSystem, FileNotFoundError, StatInfo, ToUnicode
from future import Future
import logging
import re
+import posixpath
import xml.dom.minidom as xml
from xml.parsers.expat import ExpatError
@@ -118,15 +119,14 @@ class SubversionFileSystem(FileSystem):
return StatInfo('0', {})
def Stat(self, path):
- directory = path.rsplit('/', 1)[0]
+ directory, filename = posixpath.split(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