Chromium Code Reviews| Index: chrome/common/extensions/docs/server2/server_instance.py |
| =================================================================== |
| --- chrome/common/extensions/docs/server2/server_instance.py (revision 196927) |
| +++ chrome/common/extensions/docs/server2/server_instance.py (working copy) |
| @@ -24,8 +24,10 @@ |
| from local_file_system import LocalFileSystem |
| from object_store_creator import ObjectStoreCreator |
| from offline_file_system import OfflineFileSystem |
| +from patched_file_system import PatchedFileSystem |
| from path_canonicalizer import PathCanonicalizer |
| from reference_resolver import ReferenceResolver |
| +from rietveld_patcher import RietveldPatcher |
| from samples_data_source import SamplesDataSource |
| from sidenav_data_source import SidenavDataSource |
| from subversion_file_system import SubversionFileSystem |
| @@ -50,7 +52,7 @@ |
| @staticmethod |
| @memoize |
| - def GetOrCreateOffline(channel): |
| + def GetOrCreateOffline(channel, branch_path=None): |
| '''Gets/creates a local ServerInstance, meaning that only resources local to |
| the server - memcache, object store, etc, are queried. This amounts to not |
| setting up the subversion nor github file systems. |
| @@ -63,6 +65,7 @@ |
| # for the caches to exist. |
| return ServerInstance( |
| channel, |
| + branch_path, |
| object_store_creator_factory, |
| CachingFileSystem(OfflineFileSystem(SubversionFileSystem), |
| object_store_creator_factory), |
| @@ -73,7 +76,7 @@ |
| ServerInstance._GetOrCreateGithubFileSystem()) |
| @staticmethod |
| - def CreateOnline(channel): |
| + def CreateOnline(channel, branch_path=None, issue=None): |
| '''Creates/creates an online server instance, meaning that both local and |
| subversion/github resources are queried. |
| ''' |
| @@ -102,7 +105,23 @@ |
| AppEngineUrlFetcher(viewvc_url)), |
| object_store_creator_factory) |
| + if issue is not None: |
| + object_store_creator_factory = ObjectStoreCreator.Factory( |
| + GetAppVersion(), |
| + branch, |
|
not at google - send to devlin
2013/04/30 15:37:42
this shouldn't actually use the branch, we're only
方觉(Fang Jue)
2013/05/01 15:27:25
Done.
|
| + start_empty=True, |
| + persistent=False, |
| + more={'issue': issue}) |
|
not at google - send to devlin
2013/04/30 15:37:42
and I guess you wouldn't need issue:issue here - h
方觉(Fang Jue)
2013/05/01 15:27:25
Done.
|
| + rietveld_patcher = RietveldPatcher( |
| + svn_constants.EXTENSIONS_PATH, |
| + issue, |
| + AppEngineUrlFetcher(url_constants.CODEREVIEW_SERVER), |
| + object_store_creator_factory) |
| + svn_file_system = PatchedFileSystem(svn_file_system, |
| + rietveld_patcher) |
| + |
| return ServerInstance(channel, |
| + branch_path, |
| object_store_creator_factory, |
| svn_file_system, |
| ServerInstance._GetOrCreateGithubFileSystem()) |
| @@ -110,6 +129,7 @@ |
| @staticmethod |
| def CreateForTest(file_system): |
| return ServerInstance('test', |
| + None, |
| ObjectStoreCreator.TestFactory(), |
| file_system, |
| None) |
| @@ -137,6 +157,7 @@ |
| def __init__(self, |
| channel, |
| + branch_path, |
| object_store_creator_factory, |
| svn_file_system, |
| github_file_system): |
| @@ -202,7 +223,8 @@ |
| self.compiled_fs_factory, |
| self.ref_resolver_factory, |
| svn_constants.PUBLIC_TEMPLATE_PATH, |
| - svn_constants.PRIVATE_TEMPLATE_PATH) |
| + svn_constants.PRIVATE_TEMPLATE_PATH, |
| + branch_path) |
| self.example_zipper = ExampleZipper( |
| self.compiled_fs_factory, |