You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "C. Michael Pilato" <cm...@collab.net> on 2004/03/18 18:22:49 UTC

Re: svn commit: r9112 - in tags: 0.10 0.10.0 0.15 0.15.0 0.16 0.16.0 0.17 0.17.0 0.18 0.18.0 0.19 0.19.0 0.20 0.20.0 0.21 0.21.0 0.22 0.22.0 0.23 0.23.0 0.24 0.24.0 0.25 0.25.0 0.26 0.26.0 0.28 0.28.0 0.6 0.6.0 0.7 0.7.0 0.8 0.8.0 0.9 0.9.0

cmpilato@tigris.org writes:

> Rename tags for 3-tuple consistency.  This change brought to you by
> a custom one-off script written in Python to the Subversion bindings.
> Kids, do not try this at home. 

In case anyone was wondering:

   #!/usr/bin/env python2
   import sys
   from svn import core, repos, fs
   
   log_msg = \
   """Rename tags for 3-tuple consistency.  This change brought to you by
   a custom one-off script written in Python to the Subversion bindings.
   Kids, do not try this at home. """
   
   core.apr_initialize()
   pool = core.svn_pool_create(None)
   repo = repos.svn_repos_open(sys.argv[1], pool)
   fsptr = repos.svn_repos_fs(repo)
   youngest = fs.youngest_rev(fsptr, pool)
   rev_root = fs.revision_root(fsptr, youngest, pool)
   fn = repos.svn_repos_fs_begin_txn_for_commit
   txnp = fn (repo, youngest, 'cmpilato', log_msg, pool)
   txn_root = fs.txn_root(txnp, pool)
   entries = fs.dir_entries(txn_root, '/tags', pool).keys()
   sub = core.svn_pool_create(pool)
   for entry in entries:
       core.svn_pool_clear(sub)
       pieces = entry.split('.')
       if len(pieces) == 2:
           try:
               int(pieces[0])
               int(pieces[1])
               new_entry = entry + '.0'
               fs.copy(rev_root, '/tags/' + entry, txn_root,
                       '/tags/' + new_entry, sub)
               print 'Renaming tag: %s -> %s' % (entry, new_entry)
               fs.delete(txn_root, '/tags/' + entry, sub)
           except ValueError:
               pass
   fs.commit_txn(txnp, pool)
   core.svn_pool_destroy(sub)

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

Re: svn commit: r9112 - in tags: 0.10 0.10.0 0.15 0.15.0 0.16 0.16.0 0.17 0.17.0 0.18 0.18.0 0.19 0.19.0 0.20 0.20.0 0.21 0.21.0 0.22 0.22.0 0.23 0.23.0 0.24 0.24.0 0.25 0.25.0 0.26 0.26.0 0.28 0.28.0 0.6 0.6.0 0.7 0.7.0 0.8 0.8.0 0.9 0.9.0

Posted by Greg Hudson <gh...@MIT.EDU>.
On Fri, 2004-03-19 at 20:23, Nuutti Kotivuori wrote:
> | $ svnremoteshell.py

Another idea along these lines is long-lived transactions:

http://subversion.tigris.org/servlets/ReadMsg?list=dev&msgId=188086

and a third idea (which you brought up in a response to the message I
just pointed at) is being able to batch up client operations on URLs
into a single commit.

I think, given the rarity of these operations, that we want to select
for the option which has the least impact on the code and on the
interface.  "svnremoteshell" is perhaps the best option because (1) it
doesn't pollute the command namespace, (2) requires no library changes
(I hope), and (3) lets you see what you're doing using the "ls"
command.  And it's still scriptable if you can feed it stuff on stdin.

As usual, implementing it in Python has the problem that people can't
use it without building the bindings, with the corresponding benefit
that it probably requires fewer lines of code.


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

Re: svn commit: r9112 - in tags: 0.10 0.10.0 0.15 0.15.0 0.16 0.16.0 0.17 0.17.0 0.18 0.18.0 0.19 0.19.0 0.20 0.20.0 0.21 0.21.0 0.22 0.22.0 0.23 0.23.0 0.24 0.24.0 0.25 0.25.0 0.26 0.26.0 0.28 0.28.0 0.6 0.6.0 0.7 0.7.0 0.8 0.8.0 0.9 0.9.0

Posted by Nuutti Kotivuori <na...@iki.fi>.
C. Michael Pilato wrote:
> cmpilato@tigris.org writes:
>
>> Rename tags for 3-tuple consistency.  This change brought to you by
>> a custom one-off script written in Python to the Subversion
>> bindings.  Kids, do not try this at home.
>
> In case anyone was wondering:

[...]

I was wondering - wanting to make such reorganizations in a single
commit is not that odd. And unless something has taken a leap forward
while I was looking the other way, that is not possible right now with
the normal subversion client without checking out all the trees.

So how about:

,----
| $ svnremoteshell.py
| > cd http://svn.collab.net/repos/svn/tags/
| > ls
| 0.10/
| 0.15/
| 0.16/
| [...]
| 0.8/
| 0.9/
| > mv 0.6 0.6.0
| > mv 0.7 0.6.0
| [...]
| > mv 0.28 0.28.0
| > commit
| > ^D
| $
`----

I am guessing that minute manipulations of the force that binds us all
together could probably procure up such a thing, with just about any
language bindings.

Any takers?

-- Naked

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