Show More
@@ -26,12 +26,12 b' import logging' | |||
|
26 | 26 | import os |
|
27 | 27 | import re |
|
28 | 28 | import shutil |
|
29 | import time | |
|
30 | 29 | |
|
31 | 30 | from zope.cachedescriptors.property import Lazy as LazyProperty |
|
32 | 31 | |
|
33 | 32 | from rhodecode.lib.compat import OrderedDict |
|
34 |
from rhodecode.lib.datelib import |
|
|
33 | from rhodecode.lib.datelib import ( | |
|
34 | utcdate_fromtimestamp, makedate, date_astimestamp) | |
|
35 | 35 | from rhodecode.lib.utils import safe_unicode, safe_str |
|
36 | 36 | from rhodecode.lib.vcs import connection, path as vcspath |
|
37 | 37 | from rhodecode.lib.vcs.backends.base import ( |
@@ -269,12 +269,13 b' class GitRepository(BaseRepository):' | |||
|
269 | 269 | Returns last change made on this repository as |
|
270 | 270 | `datetime.datetime` object. |
|
271 | 271 | """ |
|
272 | return utcdate_fromtimestamp(self._get_mtime(), makedate()[1]) | |
|
272 | try: | |
|
273 | return self.get_commit().date | |
|
274 | except RepositoryError: | |
|
275 | tzoffset = makedate()[1] | |
|
276 | return utcdate_fromtimestamp(self._get_fs_mtime(), tzoffset) | |
|
273 | 277 | |
|
274 | def _get_mtime(self): | |
|
275 | try: | |
|
276 | return time.mktime(self.get_commit().date.timetuple()) | |
|
277 | except RepositoryError: | |
|
278 | def _get_fs_mtime(self): | |
|
278 | 279 |
|
|
279 | 280 |
|
|
280 | 281 |
|
@@ -367,14 +367,15 b' class MercurialRepository(BaseRepository' | |||
|
367 | 367 | def last_change(self): |
|
368 | 368 | """ |
|
369 | 369 | Returns last change made on this repository as |
|
370 | `datetime.datetime` object | |
|
370 | `datetime.datetime` object. | |
|
371 | 371 | """ |
|
372 | return utcdate_fromtimestamp(self._get_mtime(), makedate()[1]) | |
|
372 | try: | |
|
373 | return self.get_commit().date | |
|
374 | except RepositoryError: | |
|
375 | tzoffset = makedate()[1] | |
|
376 | return utcdate_fromtimestamp(self._get_fs_mtime(), tzoffset) | |
|
373 | 377 | |
|
374 | def _get_mtime(self): | |
|
375 | try: | |
|
376 | return date_astimestamp(self.get_commit().date) | |
|
377 | except RepositoryError: | |
|
378 | def _get_fs_mtime(self): | |
|
378 | 379 |
|
|
379 | 380 |
|
|
380 | 381 |
|
General Comments 0
You need to be logged in to leave comments.
Login now