Comments
Patch
@@ -69,7 +69,6 @@ from mercurial import (
namespaces,
node,
obsolete,
- obsutil,
patch,
phases,
registrar,
@@ -555,6 +554,16 @@ def _showlasttouched(repo, fm, opts):
fm.plain('\n')
fm.end()
+getmarkers = None
+try:
+ from mercurial import obsutil
+ getmarkers = getattr(obsutil, 'getmarkers', None)
+except ImportError:
+ pass
+
+if getmarkers is None:
+ getmarkers = obsolete.getmarkers
+
def _getlasttouched(repo, topics):
"""
Calculates the last time a topic was used. Returns a dictionary of seconds
@@ -576,7 +585,7 @@ def _getlasttouched(repo, topics):
maxtime = rt
# looking on the markers also to get more information and accurate
# last touch time.
- obsmarkers = obsutil.getmarkers(repo, [repo[revs].node()])
+ obsmarkers = getmarkers(repo, [repo[revs].node()])
for marker in obsmarkers:
rt = marker.date()
if rt[0] > maxtime[0]: