diff options
author | W. Trevor King <wking@drexel.edu> | 2009-08-31 13:16:48 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-08-31 13:16:48 -0400 |
commit | 5e8576a48fae6e9f7a9699d57571e926d7e6e236 (patch) | |
tree | 82600e1eedbeb059cb03903fbbfa81be5778459e /libbe/bugdir.py | |
parent | 830522c293a479636d7bfc0fff125ec57f06e9a3 (diff) | |
download | bugseverywhere-5e8576a48fae6e9f7a9699d57571e926d7e6e236.tar.gz |
Upgrade duplicate bugdirs if necessary (e.g. for `be diff').
Also moved pre-YAML mapfile handling in mapfile.parse() into
upgrade.Upgrade_1_0_to_2._upgrade_mapfile().
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r-- | libbe/bugdir.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 544f6b2..5946c04 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -411,7 +411,8 @@ settings easy. Don't set this attribute. Set .rcs instead, and settings = self._get_saved_settings() self._save_settings(self.get_path("settings"), settings) - def get_version(self, path=None, use_none_rcs=False): + def get_version(self, path=None, use_none_rcs=False, + for_duplicate_bugdir=False): """ Requires disk access. """ @@ -426,7 +427,11 @@ settings easy. Don't set this attribute. Set .rcs instead, and if path == None: path = self.get_path("version") - version = RCS.get_file_contents(path).rstrip("\n") + allow_no_rcs = not RCS.path_in_root(path) + if allow_no_rcs == True: + assert for_duplicate_bugdir == True + version = RCS.get_file_contents( + path, allow_no_rcs=allow_no_rcs).rstrip("\n") return version def set_version(self): @@ -504,6 +509,12 @@ settings easy. Don't set this attribute. Set .rcs instead, and def duplicate_bugdir(self, revision): duplicate_path = self.rcs.duplicate_repo(revision) + duplicate_version_path = os.path.join(duplicate_path, ".be", "version") + version = self.get_version(duplicate_version_path, + for_duplicate_bugdir=True) + if version != upgrade.BUGDIR_DISK_VERSION: + upgrade.upgrade(duplicate_path, version) + # setup revision RCS as None, since the duplicate may not be # initialized for versioning duplicate_settings_path = os.path.join(duplicate_path, |