From 986e46aa72a2fc5086d2bf3232b7e71b9184e96a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 4 Dec 2008 18:33:33 -0500 Subject: [PATCH] Fixed lack of user_id caching in bugdir.BugDir --- libbe/bugdir.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libbe/bugdir.py b/libbe/bugdir.py index 98110dd..7885224 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -162,10 +162,12 @@ class BugDir (list, settings_object.SavedSettingsObject): check_fn=_check_encoding) def encoding(): return {} + def _setup_user_id(self, user_id): + self.rcs.user_id = user_id def _guess_user_id(self): return self.rcs.get_user_id() def _set_user_id(self, old_user_id, new_user_id): - self.rcs.user_id = new_user_id + self._setup_user_id(new_user_id) self._prop_save_settings(old_user_id, new_user_id) @_versioned_property(name="user_id", @@ -283,7 +285,7 @@ settings easy. Don't set this attribute. Set .rcs instead, and if rcs == None: rcs = self._guess_rcs(allow_rcs_init) self.rcs = rcs - user_id = self.rcs.get_user_id() + self._setup_user_id(self.user_id) def _find_root(self, path): """ @@ -351,9 +353,7 @@ settings easy. Don't set this attribute. Set .rcs instead, and self.load_settings() self.rcs = rcs.rcs_by_name(self.rcs_name) - self._setup_encoding(self.encoding) - self._setup_severities(self.severities) - self._setup_status(self.active_status, self.inactive_status) + self._setup_user_id(self.user_id) def load_all_bugs(self): "Warning: this could take a while." @@ -372,6 +372,10 @@ settings easy. Don't set this attribute. Set .rcs instead, and def load_settings(self): self.settings = self._get_settings(self.get_path("settings")) self._setup_saved_settings() + self._setup_user_id(self.user_id) + self._setup_encoding(self.encoding) + self._setup_severities(self.severities) + self._setup_status(self.active_status, self.inactive_status) def _get_settings(self, settings_path): allow_no_rcs = not self.rcs.path_in_root(settings_path) -- 2.26.2