• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

修訂5a6594a7f432a80e5a1e455bace17c91620bae64 (tree)
時間2012-05-22 00:34:56
作者Jenny Steele <jsteele@geek...>
CommiterCory Johns

Log Message

[#4015] Fixes for svn commits missing data breaking repo clone

Change Summary

差異

--- a/Allura/allura/tasks/repo_tasks.py
+++ b/Allura/allura/tasks/repo_tasks.py
@@ -61,10 +61,9 @@ def clone(
6161 subject=u'SourceForge Repo Clone Failed',
6262 message_id=h.gen_message_id(),
6363 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))
6867
6968 @task
7069 def reclone(*args, **kwargs):
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -259,12 +259,15 @@ class SVNImplementation(M.RepositoryImplementation):
259259 log.info('ClientError processing %r %r, treating as empty', ci, self._repo, exc_info=True)
260260 log_entry = Object(date=0, message='', changed_paths=[])
261261 # Save commit metadata
262+ log_date = None
263+ if hasattr(log_entry, 'date'):
264+ log_date = datetime.utcfromtimestamp(log_entry.date)
262265 ci.committed = Object(
263266 name=log_entry.get('author', '--none--'),
264267 email='',
265- date=datetime.utcfromtimestamp(log_entry.date))
268+ date=log_date)
266269 ci.authored=Object(ci.committed)
267- ci.message=log_entry.message
270+ ci.message=log_entry.get("message", "--none--")
268271 if revno > 1:
269272 parent_oid = self._oid(revno - 1)
270273 ci.parent_ids = [ parent_oid ]
@@ -278,13 +281,14 @@ class SVNImplementation(M.RepositoryImplementation):
278281 D=ci.diffs.removed,
279282 M=ci.diffs.changed,
280283 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))
288292
289293 def refresh_commit_info(self, oid, seen_object_ids, lazy=True):
290294 from allura.model.repo import CommitDoc
@@ -301,15 +305,18 @@ class SVNImplementation(M.RepositoryImplementation):
301305 except pysvn.ClientError:
302306 log.info('ClientError processing %r %r, treating as empty', oid, self._repo, exc_info=True)
303307 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)
304311 user = Object(
305312 name=log_entry.get('author', '--none--'),
306313 email='',
307- date=datetime.utcfromtimestamp(log_entry.date))
314+ date=log_date)
308315 args = dict(
309316 tree_id=None,
310317 committed=user,
311318 authored=user,
312- message=log_entry.message,
319+ message=log_entry.get("message", "--none--"),
313320 parent_ids=[],
314321 child_ids=[])
315322 if revno > 1: