[PATCH 01 of 10 V4] obsolete: rename `getobscache` into `getrevs`
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Thu Oct 18 22:52:24 UTC 2012
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1350599293 -7200
# Node ID 16b9dd6ede0e09ae54ca957d8acd87e74c150d0f
# Parent 361ab1e2086f6db05b260cabc1702dd3323243dc
obsolete: rename `getobscache` into `getrevs`
The old name was not very good for two reasons:
- caller does not care about "cache",
- set of revision returned may not be obsolete at all.
The new name was suggested by Kevin Bullock.
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -233,15 +233,15 @@
def obsolete(self):
"""True if the changeset is obsolete"""
- return self.rev() in obsmod.getobscache(self._repo, 'obsolete')
+ return self.rev() in obsmod.getrevs(self._repo, 'obsolete')
def extinct(self):
"""True if the changeset is extinct"""
- return self.rev() in obsmod.getobscache(self._repo, 'extinct')
+ return self.rev() in obsmod.getrevs(self._repo, 'extinct')
def unstable(self):
"""True if the changeset is not obsolete but it's ancestor are"""
- return self.rev() in obsmod.getobscache(self._repo, 'unstable')
+ return self.rev() in obsmod.getrevs(self._repo, 'unstable')
def _fileinfo(self, path):
if '_manifest' in self.__dict__:
diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -376,7 +376,7 @@
return func
return decorator
-def getobscache(repo, name):
+def getrevs(repo, name):
"""Return the set of revision that belong to the <name> set
Such access may compute the set and cache it for future use"""
diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -622,7 +622,7 @@
"""
# i18n: "extinct" is a keyword
getargs(x, 0, 0, _("extinct takes no arguments"))
- extincts = obsmod.getobscache(repo, 'extinct')
+ extincts = obsmod.getrevs(repo, 'extinct')
return [r for r in subset if r in extincts]
def extra(repo, subset, x):
@@ -977,7 +977,7 @@
Mutable changeset with a newer version."""
# i18n: "obsolete" is a keyword
getargs(x, 0, 0, _("obsolete takes no arguments"))
- obsoletes = obsmod.getobscache(repo, 'obsolete')
+ obsoletes = obsmod.getrevs(repo, 'obsolete')
return [r for r in subset if r in obsoletes]
def origin(repo, subset, x):
@@ -1456,7 +1456,7 @@
"""
# i18n: "unstable" is a keyword
getargs(x, 0, 0, _("unstable takes no arguments"))
- unstables = obsmod.getobscache(repo, 'unstable')
+ unstables = obsmod.getrevs(repo, 'unstable')
return [r for r in subset if r in unstables]
More information about the Mercurial-devel
mailing list