PiRSquared17 / svnplot

Automatically exported from code.google.com/p/svnplot
0 stars 0 forks source link

Error "Unknown node kind" from svnlog2sqlite.py version 1.4 #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. svnlog2sqlite.py --linecount --log svn://${SVNPATH} sqlite.db

What is the expected output? What do you see instead?

Sanitized error output:

Debug Logging to file /home/XXX/public_html/svnplot/svnlog2sqlite.log
Found Error. Rolled back recent changes
Error type <class 'pysvn._pysvn_2_6.ClientError'>
SVN Error : Unknown node kind for 'svn://AAA/trunk/fpga/BBB.log'
HINT : You should never get this error. Please report this to svnplot issue base

What version of the product are you using? On what operating system?

Version 1.4, using pysvn 1.7.2, against a 1.6.* Subversion repository

Please provide any additional information below.

When I look at the viewvc for the log, I see that:

- In r8350 the file was deleted
- The file was part of a directory that was copied from another location r8177
- You're ASSUMING that if this entry doesn't have a 'copyfrom_revision', and 
'copyfrom_path', then it must have come from revision (r8350 - 1) = r8349, but 
it CAN come from another place.

Details:

- Each entry of the changed_paths list is a dictionary with: 
    * path - string - the path in the repository
    * action - string
    * copyfrom_path - string - if copied, the original path, else None
    * copyfrom_revision - pysvn.Revision - if copied, the revision of the original, else None
- When you go through the list, and you come to an entry without a 
'copyfrom_path', you should see if its parent was copied from some place else.

For how ViewVC does it, see:

http://guest@viewvc.tigris.org/svn/viewvc/trunk/lib/vclib/svn/svn_repos.py

Original issue reported on code.google.com by imran2...@gmail.com on 25 Feb 2011 at 5:08

GoogleCodeExporter commented 9 years ago
Which version of svnplot you are using ? Comment says version 1.4. But I have 
not released version 1.4. Current version in 0.7.4.

Many issues related to unknown node kind are fixed in 0.7.4. 

>>- When you go through the list, and you come to an entry without a 
'copyfrom_path', >>you should see if its parent was copied from some place else.
svnplot is already doing this. May be I have missed some case. I will have a 
look at the viewvc code. Thanks for the link. 

regards,
Nitin

Original comment by nitinbh...@gmail.com on 26 Feb 2011 at 3:28

GoogleCodeExporter commented 9 years ago
My apologies, I was indeed using 0.7.4 I looked in Subversion and made sure 
that the offending code was still present before I submitted the bug.

The offending lines is in the file svnlogiter.py:
            if( self.change_type() == 'D'):
                #if change type is 'D' then reduce the 'revno' to appropriately detect the binary file type.
                logging.debug("Found file deletion for <%s> XXX" % filepath)
                logging.debug("XXX< %s> %d" % (filepath, revno))
                filepath = self.prev_filepath()
                revno= self.prev_revno()
                logging.debug("XXX <%s> %d" % (filepath, revno))
            binary = self.logclient.isBinaryFile(filepath, revno)

The problem is that you call self.prev_filepath(), and self.prev_revno() which 
don't take into account whether a parent directory of the current file was 
copied from elewhere.

Output (with my additional debug statements):

2011-02-26 08:54:16,804 DEBUG Updating line count for revision 8350
2011-02-26 08:54:16,804 DEBUG Changed path count : 16
2011-02-26 08:54:16,807 DEBUG Using file level revision diff
2011-02-26 08:54:16,808 DEBUG DiffLineCount 8350 : /project/XXX/tags/XXX/ : A : 
0 : 0
2011-02-26 08:54:16,809 DEBUG Found file deletion for 
</project/XXX/tags/XXX/XXX/XXX_editor.log>
2011-02-26 08:54:16,809 DEBUG XXX< /project/XXX/tags/XXX/XXX/XXX_editor.log> 
8350
2011-02-26 08:54:16,810 DEBUG XXX </project/XXX/trunk/XXX/XXX_editor.log> 8349
2011-02-26 08:54:16,810 DEBUG Binary file check for file </project/XXX/tru
nk/XXX/XXX_editor.log> revision:8349
2011-02-26 08:54:16,819 ERROR Error in diffline count

Above, it goes from revision 8350, to 8349, which it shouldn't, and also gets 
the parent path wrong as well.

Original comment by imran2...@gmail.com on 26 Feb 2011 at 2:00

GoogleCodeExporter commented 9 years ago
>>The problem is that you call self.prev_filepath(), and self.prev_revno() 
which don't >>take into account whether a parent directory of the current file 
was copied from >>elewhere.

For every log entry,'__updateCopyFromPaths' is called which update 
prev_filepath and prev_revno in case a parent directory of the current file was 
copied from elsewhere. It is possible that I missed some condition in 
__updateCopyFromPaths function.

can you send me the log entries for the revision (8350). I will get some idea 
what is going wrong ?

Original comment by nitinbh...@gmail.com on 28 Feb 2011 at 4:17

GoogleCodeExporter commented 9 years ago
version 0.7.5 contains some more fixes for unknown node kind errors. Please 
check if this solves your problem

Original comment by nitinbh...@gmail.com on 28 May 2011 at 1:44

GoogleCodeExporter commented 9 years ago
i have not seen 'unknown kind' reports after the latest release. Hence marking 
this as fixed.

Original comment by nitinbh...@gmail.com on 9 Aug 2011 at 5:32