allura
修訂 | 88a95c39fa86f447193e58c229643e0c953b4468 (tree) |
---|---|
時間 | 2010-10-26 03:31:42 |
作者 | Rick Copeland <rcopeland@geek...> |
Commiter | Rick Copeland |
[#1074] - Fixes for followup push
@@ -256,7 +256,8 @@ class Repository(Artifact): | ||
256 | 256 | self.compute_diffs(commit_ids) |
257 | 257 | for head in self.heads + self.branches + self.tags: |
258 | 258 | ci = self.commit(head.object_id) |
259 | - head.count = ci.count_revisions() | |
259 | + if ci is not None: | |
260 | + head.count = ci.count_revisions() | |
260 | 261 | session(self).flush() |
261 | 262 | return len(commit_ids) |
262 | 263 |
@@ -187,7 +187,7 @@ class GitImplementation(M.RepositoryImplementation): | ||
187 | 187 | def _setup_receive_hook(self): |
188 | 188 | 'Set up the git post-commit hook' |
189 | 189 | text = self.post_receive_template.substitute( |
190 | - url=tg.config.get('base_url', 'localhost:8080') | |
190 | + url=tg.config.get('base_url', 'http://localhost:8080/') | |
191 | 191 | + self._repo.url()[1:] + 'refresh') |
192 | 192 | fn = os.path.join(self._repo.fs_path, self._repo.name, 'hooks', 'post-receive') |
193 | 193 | with open(fn, 'w') as fp: |
@@ -18,8 +18,14 @@ def main(): | ||
18 | 18 | for cls in (GM.Repository, HM.Repository, SM.Repository): |
19 | 19 | for repo in cls.query.find(): |
20 | 20 | c.app = repo.app |
21 | - repo.refresh() | |
22 | - repo._impl._setup_receive_hook() | |
21 | + try: | |
22 | + repo.refresh() | |
23 | + except: | |
24 | + log.exception('Error refreshing %r', repo) | |
25 | + try: | |
26 | + repo._impl._setup_receive_hook() | |
27 | + except: | |
28 | + log.exception('Error setting up receive hook for %r', repo) | |
23 | 29 | |
24 | 30 | if __name__ == '__main__': |
25 | 31 | main() |