Rev 813: Update docstrings. in file:///data/jelmer/bzr-svn/0.4/
Jelmer Vernooij
jelmer at samba.org
Sat Dec 15 19:23:22 GMT 2007
At file:///data/jelmer/bzr-svn/0.4/
------------------------------------------------------------
revno: 813
revision-id:jelmer at samba.org-20071215192321-u0n6b5efnp7crps7
parent: jelmer at samba.org-20071215190511-193n0dmh7o4h3ks1
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sat 2007-12-15 20:23:21 +0100
message:
Update docstrings.
modified:
logwalker.py logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
revids.py revids.py-20070416220458-36vfa0730cchevp1-1
=== modified file 'logwalker.py'
--- a/logwalker.py 2007-12-14 15:56:28 +0000
+++ b/logwalker.py 2007-12-15 19:23:21 +0000
@@ -120,15 +120,13 @@
self.db.commit()
def follow_path(self, path, revnum):
- """Return iterator over all the revisions between revnum and
- 0 named path or inside path.
-
- :param path: Branch path to start reporting (in revnum)
- :param revnum: Start revision.
-
- :return: An iterators that yields tuples with (path, paths, revnum)
- where paths is a dictionary with all changes that happened in path
- in revnum.
+ """Return iterator over all the revisions between revnum and 0 named path or inside path.
+
+ :param path: Branch path to start reporting (in revnum)
+ :param revnum: Start revision.
+ :return: An iterator that yields tuples with (path, paths, revnum)
+ where paths is a dictionary with all changes that happened in path
+ in revnum.
"""
assert revnum >= 0
@@ -240,7 +238,11 @@
return (self.db.execute("select 1 from changed_path where path='%s' and rev=%d" % (path, revnum)).fetchone() is not None)
def find_children(self, path, revnum):
- """Find all children of path in revnum."""
+ """Find all children of path in revnum.
+
+ :param path: Path to check
+ :param revnum: Revision to check
+ """
path = path.strip("/")
transport = self._get_transport()
ft = transport.check_path(path, revnum)
=== modified file 'revids.py'
--- a/revids.py 2007-12-06 15:54:08 +0000
+++ b/revids.py 2007-12-15 19:23:21 +0000
@@ -14,6 +14,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+"""Revision id generation and caching."""
+
from bzrlib.errors import (InvalidRevisionId, NoSuchRevision)
MAPPING_VERSION = 3
@@ -22,6 +24,11 @@
import urllib
def escape_svn_path(x):
+ """Escape a Subversion path for use in a revision identifier.
+
+ :param x: Path
+ :return: Escaped path
+ """
if isinstance(x, unicode):
x = x.encode("utf-8")
return urllib.quote(x, "")
@@ -98,9 +105,21 @@
self.cachedb.commit()
def set_last_revnum_checked(self, scheme, revnum):
+ """Remember the latest revision number that has been checked
+ for a particular scheme.
+
+ :param scheme: Branching scheme name.
+ :param revnum: Revision number.
+ """
self.cachedb.execute("replace into revids_seen (scheme, max_revnum) VALUES (?, ?)", (scheme, revnum))
def last_revnum_checked(self, scheme):
+ """Retrieve the latest revision number that has been checked
+ for revision ids for a particular branching scheme.
+
+ :param scheme: Branching scheme name.
+ :return: Last revision number checked or 0.
+ """
ret = self.cachedb.execute(
"select max_revnum from revids_seen where scheme = ?", (scheme,)).fetchone()
if ret is None:
@@ -108,6 +127,12 @@
return int(ret[0])
def lookup_revid(self, revid):
+ """Lookup the details for a particular revision id.
+
+ :param revid: Revision id.
+ :return: Tuple with path inside repository, minimum revision number, maximum revision number and
+ branching scheme.
+ """
ret = self.cachedb.execute(
"select path, min_revnum, max_revnum, scheme from revmap where revid='%s'" % revid).fetchone()
if ret is None:
More information about the bazaar-commits
mailing list