Besac1 / gource

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

SVN folder renaming does not work in Gource #141

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When a folder is renamed in SVN this change is not represented in Gource, and 
when a file in the renamed folder is edited, the new folder appears but the old 
folder remains in the graph indefinitely.

I think a similar problem was already reported in Issue 136 and previously in 
Issue 31, but it is still present in gource-0.37.

What steps will reproduce the problem?
1. I created a fresh repository, added file0.txt to its root folder, and 
committed:

/file0.txt

2. I created a folder1 containing a file1.txt and committed:

/file0.txt
/folder1/file1.txt

3. I renamed folder1 to folder2 and committed:

/file0.txt
/folder2/file1.txt

Gource does not represent this change, and file1.txt is still represented as 
being in folder1 in the graph.  This state is attached as my-project-log-1.xml.

4. Now I edited file1.txt and committed:

/file0.txt
/folder2/file1.txt <- edited

Gource now adds folder2/file1.txt to its graph, but still keeps 
folder1/file.txt.  This state is attached as my-project-log-2.xml.

What is the expected output? What do you see instead?
The expected output would be that after renaming folder1 to folder2 this change 
is represended in the graph.

What version of the product are you using? On what operating system?
gource-0.37.win32

Please provide any additional information below.
Thanks for this wonderful program.  Its output is a piece of art.

P.S.: If I do not add file0.txt to the root folder, folder1/file1.txt is not 
represented with an edge and a node, but just as a node, without the folder1 
edge.  I will submit a separate issue for this.

Original issue reported on code.google.com by m.grit...@gmail.com on 5 Nov 2011 at 11:33

Attachments:

GoogleCodeExporter commented 8 years ago
Ok thanks I will have a look at this.

Original comment by acaudw...@gmail.com on 6 Nov 2011 at 1:42

GoogleCodeExporter commented 8 years ago
What version of subversion do you have?

I have SVN 1.6.17 and it seems to always include a redundant delete message for 
the old file name along with any rename. My guess is they have changed this 
behavior.

Cheers

Andrew

Original comment by acaudw...@gmail.com on 7 Nov 2011 at 2:43

GoogleCodeExporter commented 8 years ago
I just tried this on Windows with 1.7.1, this also generated delete action when 
renaming.

Original comment by acaudw...@gmail.com on 7 Nov 2011 at 6:16

GoogleCodeExporter commented 8 years ago
I used TortoiseSVN 1.7.1 on Windows 7.  Did you also rename the folder1 to 
folder2, and not the file?

Original comment by m.grit...@gmail.com on 7 Nov 2011 at 7:41

GoogleCodeExporter commented 8 years ago
Ah k. How do you generate the log file? Do you have a second command line SVN 
client installed? What version is it?

I have tried a directory rename with TortoiseSVN 1.7.1 on Windows 7 and the GUI 
log does appear to show a delete of folder1 and copying from folder1 to folder2 
as expected.

Original comment by acaudw...@gmail.com on 7 Nov 2011 at 8:25

GoogleCodeExporter commented 8 years ago
I created the log file with the command from the Wiki page:

  svn log -r 1:HEAD --xml --verbose --quiet > my-project-log.xml

If you innstall TortoiseSVN there is an option in the installer to also install 
the command line tools, so they are the same version.

Original comment by m.grit...@gmail.com on 7 Nov 2011 at 8:33

GoogleCodeExporter commented 8 years ago
I installed the TortoiseSVN command line client and ran that command. Same 
result.

How are you doing the rename? Either using the context menu (TortoiseSVN -> 
Rename) or 'svn rename folder1 folder2' give me the same result.

Original comment by acaudw...@gmail.com on 7 Nov 2011 at 9:07

GoogleCodeExporter commented 8 years ago
I did the rename using the TortoiseSVN Explorer context menu.  BTW, I am using 
the 64-bit Version of TortoiseSVN, but I doubt that this leads to the different 
behaviour.

Original comment by m.grit...@gmail.com on 7 Nov 2011 at 9:18

GoogleCodeExporter commented 8 years ago
If you do 'svn copy folder1 folder2' and commit that you will get an svn log 
entry like the ones you're seeing (ie an add of the new folder with a copyfrom 
and no delete of the old folder).

It seems like the delete of the old folder is necessary to distinguish between 
a copy and a rename so there probably isn't anything I can change in Gource to 
handle this differently.

Original comment by acaudw...@gmail.com on 7 Nov 2011 at 10:33

GoogleCodeExporter commented 8 years ago
And do you have an idea how your context menu Rename-command differs from mine, 
since you said yours produced also the delete log entries?

Original comment by m.grit...@gmail.com on 7 Nov 2011 at 11:23

GoogleCodeExporter commented 8 years ago
I found the difference!  If I do the commit on the renamed folder2, only the 
copyfrom tag appears in the log.  But if I do the commit on the parent folder 
instead, also the Delete tag appears.  So I had not committed the entire 
change.  Even if I do the commit on the parent folder in a separate step 
afterwards, the old folder1 correctly disappears, as can be seen in 
my-project-log.xml.  At least we now get consistent results.

One question remains though: Shouldn't the new folder2 appear in the graph 
after the rename?

Original comment by m.grit...@gmail.com on 7 Nov 2011 at 8:01

Attachments:

GoogleCodeExporter commented 8 years ago
Ok thanks for clearing that up.

As per issue 31, I haven't implemented rename or copy in Gource as yet. I have 
done some work on it but it's not ready yet.

I think I understand a bit better what's going on with these commands now at 
least.

Thanks

Original comment by acaudw...@gmail.com on 7 Nov 2011 at 10:44

GoogleCodeExporter commented 8 years ago
Ok.  Maybe you can take a final look at this excerpt I took from an actual 
project which I attached as my-project-log.xml.  In line 127

  /utilities/google_appengine/markus-gritsch/applications

gets deleted, because it was renamed to

  /website/web2py/applications

in line 200.  One problem is, that /website/web2py/applications is added as a 
file node, and not as the directory structure it was copied from.  Renaming 
does not yet work in Gource, so this could be expected.

But it seems that the delete from line 127 also does not work, since the graph 
still shows this part of the tree.  And even when

  /utilities/google_appengine

gets deleted at line 298, it remains in the graph.  Shouldn't this already be 
working in Gource?

Original comment by m.grit...@gmail.com on 8 Nov 2011 at 8:31

Attachments:

GoogleCodeExporter commented 8 years ago
Hi.

Part of the problem is that log is missing the 'kind' information, so Gource 
has to infer that those are directories. Apparently old SVN repositories don't 
have that information 
(http://old.nabble.com/Kind-information-missing-in-svn-log-xml-output-td31109154
.html).

It looks like my code to infer directories isn't working in this case, so I 
will fix that.

Original comment by acaudw...@gmail.com on 8 Nov 2011 at 8:55