allura
修訂 | 5a6594a7f432a80e5a1e455bace17c91620bae64 (tree) |
---|---|
時間 | 2012-05-22 00:34:56 |
作者 | Jenny Steele <jsteele@geek...> |
Commiter | Cory Johns |
[#4015] Fixes for svn commits missing data breaking repo clone
@@ -61,10 +61,9 @@ def clone( | ||
61 | 61 | subject=u'SourceForge Repo Clone Failed', |
62 | 62 | message_id=h.gen_message_id(), |
63 | 63 | text=u''.join([ |
64 | - u'Clone of repo %s in project %s from %s failed. The SourceForge engineering team has been notified.\n', | |
65 | - u'\n', | |
66 | - u'%s', | |
67 | - ]) % (c.app.config.options.mount_point, c.project.shortname, cloned_from_url, traceback.format_exc())) | |
64 | + u'Clone of repo %s in project %s from %s failed. ', | |
65 | + u'The SourceForge engineering team has been notified.\n', | |
66 | + ]) % (c.app.config.options.mount_point, c.project.shortname, cloned_from_url)) | |
68 | 67 | |
69 | 68 | @task |
70 | 69 | def reclone(*args, **kwargs): |
@@ -259,12 +259,15 @@ class SVNImplementation(M.RepositoryImplementation): | ||
259 | 259 | log.info('ClientError processing %r %r, treating as empty', ci, self._repo, exc_info=True) |
260 | 260 | log_entry = Object(date=0, message='', changed_paths=[]) |
261 | 261 | # Save commit metadata |
262 | + log_date = None | |
263 | + if hasattr(log_entry, 'date'): | |
264 | + log_date = datetime.utcfromtimestamp(log_entry.date) | |
262 | 265 | ci.committed = Object( |
263 | 266 | name=log_entry.get('author', '--none--'), |
264 | 267 | email='', |
265 | - date=datetime.utcfromtimestamp(log_entry.date)) | |
268 | + date=log_date) | |
266 | 269 | ci.authored=Object(ci.committed) |
267 | - ci.message=log_entry.message | |
270 | + ci.message=log_entry.get("message", "--none--") | |
268 | 271 | if revno > 1: |
269 | 272 | parent_oid = self._oid(revno - 1) |
270 | 273 | ci.parent_ids = [ parent_oid ] |
@@ -278,13 +281,14 @@ class SVNImplementation(M.RepositoryImplementation): | ||
278 | 281 | D=ci.diffs.removed, |
279 | 282 | M=ci.diffs.changed, |
280 | 283 | R=ci.diffs.changed) |
281 | - for path in log_entry.changed_paths: | |
282 | - if path.copyfrom_path: | |
283 | - ci.diffs.copied.append(dict( | |
284 | - old=h.really_unicode(path.copyfrom_path), | |
285 | - new=h.really_unicode(path.path))) | |
286 | - continue | |
287 | - lst[path.action].append(h.really_unicode(path.path)) | |
284 | + if hasattr(log_entry, 'changed_paths'): | |
285 | + for path in log_entry.changed_paths: | |
286 | + if path.copyfrom_path: | |
287 | + ci.diffs.copied.append(dict( | |
288 | + old=h.really_unicode(path.copyfrom_path), | |
289 | + new=h.really_unicode(path.path))) | |
290 | + continue | |
291 | + lst[path.action].append(h.really_unicode(path.path)) | |
288 | 292 | |
289 | 293 | def refresh_commit_info(self, oid, seen_object_ids, lazy=True): |
290 | 294 | from allura.model.repo import CommitDoc |
@@ -301,15 +305,18 @@ class SVNImplementation(M.RepositoryImplementation): | ||
301 | 305 | except pysvn.ClientError: |
302 | 306 | log.info('ClientError processing %r %r, treating as empty', oid, self._repo, exc_info=True) |
303 | 307 | log_entry = Object(date='', message='', changed_paths=[]) |
308 | + log_date = None | |
309 | + if hasattr(log_entry, 'date'): | |
310 | + log_date = datetime.utcfromtimestamp(log_entry.date) | |
304 | 311 | user = Object( |
305 | 312 | name=log_entry.get('author', '--none--'), |
306 | 313 | email='', |
307 | - date=datetime.utcfromtimestamp(log_entry.date)) | |
314 | + date=log_date) | |
308 | 315 | args = dict( |
309 | 316 | tree_id=None, |
310 | 317 | committed=user, |
311 | 318 | authored=user, |
312 | - message=log_entry.message, | |
319 | + message=log_entry.get("message", "--none--"), | |
313 | 320 | parent_ids=[], |
314 | 321 | child_ids=[]) |
315 | 322 | if revno > 1: |