Re: [viewvc-users] rebuild adds parent directory

"C. Michael Pilato" <[email protected]> Mon, 2 Dec 2013 13:29:02 -0500
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Message-ID <[email protected]>
Sorry for the delay.  Mmmmmm ... turkey ...

cvsdbadmin appears to be the problematic code, so let's start there.
I'd suggest checking what the function RootPath() is returning.

For example, I made this tweak to my copy of cvsdbadmin:

{{{
Index: bin/cvsdbadmin
===================================================================
--- bin/cvsdbadmin	(revision 2924)
+++ bin/cvsdbadmin	(working copy)
@@ -169,6 +169,7 @@

     # get repository and path, and do the work
     root, path_parts = RootPath(args[2], quiet_level)
+    print "root(%s), path_parts(%s)" % (str(root), str(path_parts))
     rootpath = vclib.ccvs.canonicalize_rootpath(root)
     try:
         cfg = viewvc.load_config(CONF_PATHNAME)
}}}

When I run cvsdbadmin now, it prints the root and path_parts that that
function returns:

$ cvsdbadmin rebuild /usr/local/cvs/ViewCVS
Using repository root `/usr/local/cvs/ViewCVS'
root(/usr/local/cvs/ViewCVS), path_parts([])
...

$ cvsdbadmin rebuild /usr/local/cvs/ViewCVS/viewcvs/lib/vclib
Using repository root `/usr/local/cvs/ViewCVS'
root(/usr/local/cvs/ViewCVS), path_parts(['viewcvs', 'lib', 'vclib'])
Purging existing data for repository root `/usr/local/cvs/ViewCVS'
...

(Notice how it doesn't matter if I point cvsdbadmin at the root of my
CVS repository or to a subdirectory thereof, it still finds the same
canonical root path for my repository.)

Other code you'll want to examine is the function AddCommit() in the
lib/cvsdb.py module.  Maybe have that code print out the SQL query
before executing it or something.

Let me know how else I can help.

-- Mike

PS: I've filed an issue for this problem that you may want to add
    yourself to the CC: of:
    http://viewvc.tigris.org/issues/show_bug.cgi?id=534


On 11/25/2013 02:46 PM, Steven Gale wrote:
> Hi Mike,
> 
> Sure I can try to debug it. Can you give me some pointers where I should
> set breakpoints and what variables to look at?
> 
> Thanks,
> Steve
> 
> 
> 
> On Mon, Nov 25, 2013 at 5:30 PM, C. Michael Pilato <[email protected]
> <mailto:[email protected]>> wrote:
> 
>     On 11/07/2013 10:42 AM, Steve Gale wrote:
>     > Hi Mike,
>     >
>     > Thanks again for your help.
>     >
>     > My repository has thousands of directories, so I cannot use the
>     the same query that you did. Instead I took the first 8 characters
>     of DIR and then grouped them.
>     >
>     > Note that the parent directory (named "cvsroot", the one above
>     CVSROOT) *does* appear in my list, unlike yours.
>     >
>     >
>     > mysql> select count(*), substr(dir, 1, 8) from dirs group by
>     substr(dir, 1, 8);
> 
>     [...]
> 
>     Steve,
> 
>     I've still not been able to identify what's going on here or to
>     reproduce the problem myself.  Are you able to debug the Python on your
>     end of things to determine what's happening?
> 
>

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=3069596

To unsubscribe from this discussion, e-mail: [[email protected]].