[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] ctypes-python-bindings branch Renames

From: Daniel Rall <dlr_at_collab.net>
Date: 2007-05-30 01:14:49 CEST

On Tue, 29 May 2007, Sage La Torra wrote:

> This patch makes some logical changes to the names of classes for the
> new python ctypes bindings. Changed classes are:
> ClientURI is now RepositoryURI
> ClientSession is now RemoteRepository
> LocalClient is now LocalRepository

RemoteRepository and LocalRepository seem more like RA objects.

...
> [[[
> Rename python classes to make them more logical. Class names now
> reflect what the class actually represents.
>
> * csvn/client.py:
> ClientURI is now RepositoryURI
> ClientSession is now RemoteRepository
> LocalClient is now LocalRepository
>
> *mucc.py,example.py:
> Use new names from client.py
> ]]]

> Index: example.py
> ===================================================================
> --- example.py (revision 25193)
> +++ example.py (working copy)
> @@ -4,7 +4,7 @@
> if os.path.exists("/tmp/test-repos"):
> svn_repos_delete("/tmp/test-repos", Pool())
> user = User(username="joecommitter")
> -repos = LocalClient("/tmp/test-repos", user=user, create=True)
> +repos = LocalRepository("/tmp/test-repos", user=user, create=True)
> print "Repos UUID: ", repos.uuid()
>
> # Create a new transaction
> @@ -61,7 +61,7 @@
> new_rev = txn.commit("Replace file3.txt with a new copy of file1.txt")
> print "Committed revision %d" % new_rev
>
> -session = ClientSession("file:///tmp/test-repos", user=user)
> +session = RemoteRepository("file:///tmp/test-repos", user=user)
>
> # Create a new transaction
> txn = session.txn()
> Index: csvn/client.py
> ===================================================================
> --- csvn/client.py (revision 25193)
> +++ csvn/client.py (working copy)
> @@ -125,14 +125,14 @@
> svn_cancel_func_t(), NULL, self.pool)
>
>
> -class ClientURI(object):
> +class RepositoryURI(object):
> """A URI to an object in a Subversion repository, stored internally in
> encoded format.
>
> When you supply URIs to a RemoteClient, or a transaction"""
>
> def __init__(self, uri, encoded=True):
> - """Create a ClientURI object from a URI. If encoded=True, the
> + """Create a RepositoryURI object from a URI. If encoded=True, the
> input string may be URI-encoded."""
> pool = Pool()
> if not encoded:
> @@ -143,12 +143,12 @@
> """Join this URI and the specified relative URI,
> adding a slash if necessary."""
> pool = Pool()
> - return ClientURI(svn_path_join(self, uri, pool))
> + return RepositoryURI(svn_path_join(self, uri, pool))
>
> def dirname(self):
> """Get the parent directory of this URI"""
> pool = Pool()
> - return ClientURI(svn_path_dirname(self, pool))
> + return RepositoryURI(svn_path_dirname(self, pool))
>
> def relative_path(self, uri, encoded=True):
> """Convert the supplied URI to a decoded path, relative to me."""
> @@ -161,13 +161,13 @@
> def longest_ancestor(self, uri):
> """Get the longest ancestor of this URI and another URI"""
> pool = Pool()
> - return ClientURI(svn_path_get_longest_ancestor(self, uri, pool))
> + return RepositoryURI(svn_path_get_longest_ancestor(self, uri, pool))
>
> def __str__(self):
> """Return the URI as a string"""
> return self._as_parameter_
>
> -class ClientSession(object):
> +class RemoteRepository(object):
>
> def __init__(self, url, user=None):
> """Open a new session to URL with the specified USER.
> @@ -175,7 +175,7 @@
>
> self.pool = Pool()
> self.iterpool = Pool()
> - self.url = ClientURI(url)
> + self.url = RepositoryURI(url)
> self.user = user
>
> self.client = POINTER(svn_client_ctx_t)()
> @@ -343,15 +343,15 @@
> # Private. Convert a repository-relative copyfrom path into a proper
> # copyfrom URI
> def _abs_copyfrom_path(self, path):
> - return self.url.join(ClientURI(path, False))
> + return self.url.join(RepositoryURI(path, False))
>
> -class LocalClient(object):
> +class LocalRepository(object):
> """A client which accesses the repository directly. This class
> may allow you to perform some administrative actions which
> cannot be performed remotely (e.g. create repositories,
> dump repositories, etc.)
>
> - Unlike ClientSession, the functions in this class do not
> + Unlike RemoteRepository, the functions in this class do not
> accept URIs, and instead only accept local filesystem
> paths.
>
> Index: mucc.py
> ===================================================================
> --- mucc.py (revision 25193)
> +++ mucc.py (working copy)
> @@ -8,7 +8,7 @@
>
> import os
> from csvn.core import *
> -from csvn.client import ClientSession, ClientURI, User
> +from csvn.client import RemoteRepository, RepositoryURI, User
> from optparse import OptionParser
>
> usage = """python mucc.py [OPTION]... [ACTION]...
> @@ -102,7 +102,7 @@
> else:
> ancestor = arg
>
> -session = ClientSession(ancestor, user=User(username=options.username))
> +session = RemoteRepository(ancestor, user=User(username=options.username))
> txn = session.txn()
>
> # Carry out the transaction

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

  • application/pgp-signature attachment: stored
Received on Wed May 30 01:14:58 2007

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.