Rev 1882: Add docstrings. in file:///data/jelmer/bzr-svn/trunk/
Jelmer Vernooij
jelmer at samba.org
Tue Sep 9 12:32:58 BST 2008
At file:///data/jelmer/bzr-svn/trunk/
------------------------------------------------------------
revno: 1882
revision-id: jelmer at samba.org-20080909113256-916idl8mupru39gz
parent: jelmer at samba.org-20080909025220-4ddkvjxem3psxh6r
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Tue 2008-09-09 13:32:56 +0200
message:
Add docstrings.
modified:
auth.py auth.py-20071209174622-w8d42k6nm5yhxvi8-1
branch.py svnbranch.py-20051017135706-11c749eb0dab04a7
branchprops.py branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
cache.py cache.py-20070520185908-qbtlcet08bllgs0f-1
changes.py changes.py-20080330205801-lh92uht2ztppvdcz-1
commit.py commit.py-20060607190346-qvq128wgfubhhgm2-1
mapping.py mapping.py-20080128201303-6cp01phc0dmc0kiv-1
=== modified file 'auth.py'
--- a/auth.py 2008-08-25 01:58:11 +0000
+++ b/auth.py 2008-09-09 11:32:56 +0000
@@ -163,7 +163,10 @@
def create_auth_baton(url):
- """Create an authentication baton for the specified URL."""
+ """Create an authentication baton for the specified URL.
+
+ :param url: URL to create auth baton for.
+ """
assert isinstance(url, str)
(scheme, netloc, path, _, _) = urlparse.urlsplit(url)
(creds, host) = urllib.splituser(netloc)
=== modified file 'branch.py'
--- a/branch.py 2008-09-08 01:19:02 +0000
+++ b/branch.py 2008-09-09 11:32:56 +0000
@@ -125,6 +125,8 @@
return self.last_revmeta().revnum
def last_revmeta(self):
+ """Return the revmeta element for the last revision in this branch.
+ """
for revmeta in self._revision_meta_history():
if not revmeta.is_hidden(self.mapping):
return revmeta
=== modified file 'branchprops.py'
--- a/branchprops.py 2008-09-02 16:34:55 +0000
+++ b/branchprops.py 2008-09-09 11:32:56 +0000
@@ -39,7 +39,8 @@
path = path.lstrip("/")
if not (path, revnum) in self._props_cache:
- self._props_cache[(path, revnum)] = logwalker.lazy_dict({}, self._real_get_properties, path, revnum)
+ self._props_cache[(path, revnum)] = logwalker.lazy_dict({}, self._real_get_properties,
+ path, revnum)
return self._props_cache[path, revnum]
def _real_get_properties(self, path, revnum):
=== modified file 'cache.py'
--- a/cache.py 2008-09-04 15:47:01 +0000
+++ b/cache.py 2008-09-09 11:32:56 +0000
@@ -98,6 +98,7 @@
self._commit_countdown = self._commit_interval
def commit(self):
+ """Commit the changes to the database."""
self.cachedb.commit()
self._commit_countdown = self._commit_interval
=== modified file 'changes.py'
--- a/changes.py 2008-09-02 23:59:15 +0000
+++ b/changes.py 2008-09-09 11:32:56 +0000
@@ -16,12 +16,18 @@
"""Utility functions for dealing with changes dictionaries as return by Subversions' log functions."""
def path_is_child(branch_path, path):
+ """Check whether path is or is under branch_path."""
return (branch_path == "" or
branch_path == path or
path.startswith(branch_path+"/"))
def find_prev_location(paths, branch_path, revnum):
+ """Find the previous location at which branch_path can be found.
+
+ :note: If branch_path wasn't copied, this will return revnum-1 as the
+ previous revision.
+ """
assert isinstance(branch_path, str)
assert isinstance(revnum, int)
if revnum == 0:
@@ -121,5 +127,6 @@
def rebase_path(path, orig_parent, new_parent):
+ """Rebase a path on a different parent."""
return (new_parent+"/"+path[len(orig_parent):].strip("/")).strip("/")
=== modified file 'commit.py'
--- a/commit.py 2008-09-09 01:46:56 +0000
+++ b/commit.py 2008-09-09 11:32:56 +0000
@@ -71,6 +71,7 @@
def update_svk_features(oldvalue, merges):
+ """Update a set of SVK features to include the specified set of merges."""
old_svk_features = parse_svk_features(oldvalue)
svk_features = set(old_svk_features)
@@ -87,6 +88,7 @@
def update_mergeinfo(repository, graph, oldvalue, baserevid, merges):
+ """Update a svn:mergeinfo property to include a specified list of merges."""
pb = ui.ui_factory.nested_progress_bar()
try:
mergeinfo = properties.parse_mergeinfo_property(oldvalue)
@@ -627,7 +629,7 @@
it is a candidate to commit.
"""
if self._texts is None:
- self._text_parents[ie.file_id] = [parent_inv[ie.file_id].revision for parent_inv in parent_invs if ie.file_id in parent_inv]
+ self._text_parents[ie.file_id] = [parent_inv[ie.file_id].revision for parent_inv in self.parent_invs if ie.file_id in parent_inv]
elif isinstance(self._texts, SvnTexts):
overridden_parents = self._texts._get_parent(ie.file_id, ie.revision)
if overridden_parents is None:
@@ -682,6 +684,13 @@
def create_branch_with_hidden_commit(repository, branch_path, revid, deletefirst=False):
+ """Create a new branch using a simple "svn cp" operation.
+
+ :param repository: Repository in which to create the branch.
+ :param branch_path: Branch path
+ :param revid: Revision id to keep as tip.
+ :param deletefirst: Whether to delete an existing branch at this location first.
+ """
revprops = {properties.PROP_REVISION_LOG: "Create new branch."}
revmeta, mapping = repository._get_revmeta(revid)
fileprops = dict(revmeta.get_fileprops().items())
@@ -970,6 +979,16 @@
def push_ancestors(target_repo, source_repo, layout, project, parent_revids, graph, create_prefix=False):
+ """Push the ancestors of a revision.
+
+ :param target_repo: Target repository.
+ :param source_repo: Source repository
+ :param layout: Subversion layout
+ :param project: Project name
+ :param parent_revids: The revision ids of the basic ancestors to push
+ :param graph: Graph object for source_repo
+ :param create_prefix: Whether to optionally create the prefix of the branches.
+ """
for parent_revid in parent_revids[1:]:
if target_repo.has_revision(parent_revid):
continue
@@ -994,6 +1013,14 @@
def create_branch_prefix(repository, revprops, bp_parts, existing_bp_parts):
+ """Create a branch prefixes (e.g. "branches")
+
+ :param repository: Subversion repository
+ :param revprops: Revision properties to set
+ :param bp_parts: Branch path elements that should be created (list of names,
+ ["branches", "foo"] for "branches/foo")
+ :param existing_bp_parts: Branch path elements that already exist.
+ """
conn = repository.transport.get_connection()
try:
ci = convert_svn_error(conn.get_commit_editor)(revprops)
=== modified file 'mapping.py'
--- a/mapping.py 2008-09-08 04:03:30 +0000
+++ b/mapping.py 2008-09-09 11:32:56 +0000
@@ -723,7 +723,7 @@
mapping_registry.register_lazy('v4', 'bzrlib.plugins.svn.mapping4',
'BzrSvnMappingv4',
'Fourth format (bzr-svn 0.5.x)')
-mapping_registry.set_default('v3')
+mapping_registry.set_default('v4')
def find_mapping(revprops, fileprops):
if SVN_REVPROP_BZR_MAPPING_VERSION in revprops:
More information about the bazaar-commits
mailing list