[viewvc-dev] RE: [PATCH] add branch support to svndbadmin [WAS: [viewvc-dev] viewvc.branches, viewvc.tags]
"Philip M. Gollucci" <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Organization | P6M7G8 Consulting |
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 C. Michael Pilato wrote: | Ah, gotcha. I missed that detail in your example. Sorry. checkins.stickytag and tags table. stickytag screams CVS to me. SVN should probably put tags in the branches table too and leave stickytag as NULL always. After all you can commit to a 'tag' like its a branch. Thoughts ? - -- - ------------------------------------------------------------------------ Philip M. Gollucci ([email protected]) o:703.549.2050x206 Senior System Admin - Riderway, Inc. http://riderway.com / http://ridecharge.com 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIRcLbdbiP+9ubjBwRAprJAJ9YCr/u7zwoLL79fgN1TK76h1qeIwCfV/VU RMn6SX/aaOLRh+5PfSM81dU= =mLsc -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
svndbadmin.diff
(text/plain, 1.2 KB)
--- svndbadmin.orig 2008-05-22 22:04:15.000000000 +0000
+++ svndbadmin 2008-06-03 22:10:44.000000000 +0000
@@ -87,6 +87,7 @@
return rev
_re_diff_change_command = re.compile('(\d+)(?:,(\d+))?([acd])(\d+)(?:,(\d+))?')
+_re_branch = re.compile('branches/([^/]+)/')
def _get_diff_counts(diff_fp):
"""Calculate the plus/minus counts by parsing the output of a
@@ -201,6 +202,7 @@
"""Adds a particular revision of the repository to the checkin database."""
revision = repo[rev]
committed = 0
+ branch = None
if verbose: print "Building commit info for revision %d..." % (rev),
@@ -210,6 +212,13 @@
for (path, action, plus, minus) in revision.changes:
directory, file = os.path.split(path)
+
+ match = re.search(_re_branch, path)
+ if match:
+ branch = match.group(1)
+ else:
+ branch = None
+
commit = cvsdb.CreateCommit()
commit.SetRepository(repo.path)
commit.SetDirectory(directory)
@@ -220,7 +229,7 @@
commit.SetTime(revision.date)
commit.SetPlusCount(plus)
commit.SetMinusCount(minus)
- commit.SetBranch(None)
+ commit.SetBranch(branch)
if action == 'add':
commit.SetTypeAdd()