Originally created by: dcommander
This is one of several tickets I am creating to log what I feel are shortcomings in the new (Allura) code viewer relative to the old (ViewVC) code viewer. In all of these cases, simply providing a way for users to continue using ViewVC would be an acceptable workaround.
In ViewVC, if a file or directory had been renamed, then the history view of said file/directory provided a link at the bottom that allowed one to easily browse the old history of the file/directory before it has been renamed. Example (see bottom of page):
http://libjpeg-turbo.svn.sourceforge.net/viewvc/libjpeg-turbo/trunk/turbojpeg.c?view=log
This is a critical feature for being able to visualize the history of a repository.
Now that our SCM history view gets its data directly from the underlying SCM tools instead of Mongo, it seems that we should be able to get rename/copy info from them fairly easily.
Created:
Related
Tickets:
#5775I have a few questions about Git implementation.
Currently we've done it with two limtations:
Firstly, it works only if in a commit only one file was renamed. Git doesn't handle renames separately - this is just file deletion and file creation. So now when you go to file history it tries to find commit where file with current name was created and some other file deleted - then it is probably rename. To fix one-file-in-commit issue, we have to compare contents of the files and diffs and this can be time consuming. Do we have to or current implementation will be enough?
Secondly, it doesn't show renames for folders (it works for files in the folder though). This seems to be possible to implement but logic will be very tricky. Do you need to show renames of folders?
Originally by: dcommander
From my point of view, I am simply trying to get back the SVN browsing functionality that ViewVC had, so the details of the git implementation aren't currently important to me personally, although others may have their own opinions on that. I would say that the same principle applies-- provide the same functionality that your old git viewer provided.
The basic workflow I need is:
-- pull up the history view of a file or folder
-- if at some point in the history, the file/folder was renamed or moved, then I want a link to a history view of the previous incarnation of the file/folder, so I can keep tracing the history back.
Currently, there is no way of distinguishing from the first revision of a file/folder and the first revision after it was copied/moved/renamed. Even if you know that it was copied/moved/renamed, it's difficult to figure out what the old name was, and even if you know the old name, you have to go through the trouble of setting a sticky revision in the browser in order to even find the old version in the tree.
Overall in the Allura SCM code we are moving away storing lots of metadata and doing computation ourselves. Rather, it'll be simpler, more robust, and often times faster to rely on the scm tool (e.g. git itself) to do the work for us.
The log view controller has already been moved to this approach. It calls
_iter_commits_with_refs
which calls into gitpython to get the data. See if you can get the rename data from git there. I know if I rungit log --stat
I get output that includes lines likereadme2.txt => readme3.txt | 1 +
You may want to look at related options to "stat" to get the easiest-to-parse format. I know I've seen times where long file paths are truncated in that stat rename output.Renames of directories aren't too important I don't think. Directories consist of files, so if we show file renames that should be sufficient.
Originally by: dcommander
I agree, as long as a directory rename/copy/move will show up in all of the individual files it affects.
closed #404, branch 42cc_5775
closed #406, branch 42cc_5775 in forge_hg repo https://sourceforge.net/p/forgehg/code/ci/42cc_5775/tree/
By the way, it seems that there's a bug in ForgeSVN (or pysvn).
How to reproduce
- create a file, commit it
- rename it using svn move {src} {dest}, commit
- go to revision where file was created and open it's history
- there should be at least one commit (about creation) but there are none of them
I've spent little time debugging it and noticed that exception is thrown
File not found: revision 3, path '/dir/a.txt'
, even if file was created in revision 2 and revision_start=revision_2Closed #405, branch 42cc_5775
Found some issues in production that need further improvement:
?path=/frontend/tags/1.1.0/
then the rename notice is gone. Then if you look at file within that folder e.g. https://sourceforge.net/p/konfidi/code/755/log/?path=/frontend/tags/1.1.0/LICENSE-LGPL.txt there is no renamed/copied information. It would be nice if that worked too (although not essential, if it isn't practical to get that info out of SVN efficiently).[3abb2e]
. This is nice (better, really), but we should get the rename info out of git and show it prominently within the table, so that people know it was renamed at that point. Also, the file size & view & download links don't work after that point - they need to use the correct file name from that commit.Created #433: [#5775] Allura Code Viewer: "copied from" improvements (2cp)
Related
Tickets:
#5775Closed #433.
je/42cc_5775
Originally by: dcommander
Hi. I'm having trouble parsing the status of this, but the published version still very definitely does not work for me. Is there a way to try out the "beta" version?
Sorry, DRC, not really. The changes first need to be reviewed and then pushed live to sf.net