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

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

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2004-03-18 19:22:49 CET

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
Received on Thu Mar 18 19:25:15 2004

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.