Currently all the 'History' links in the SCM browse go to a URL like https://sourceforge.net/p/allura/git/ci/0298d85091dd970b0c6d57c914e43643b604a6a8/log/ which shows the revisions starting at the given commit. There should be a way to view revisions limited to a specified directory or file. E.g. URL might be something like https://sourceforge.net/p/allura/git/ci/0298d85091dd970b0c6d57c914e43643b604a6a8/log/ForgeBlog/forgeblog/tests/ This needs to be implemented for Git, Hg, and SVN.
Then, change the History links so that when you're browsing a tree or file, the link goes to the /log/ URL containing the file/folder path.
Created #184: [#5037] View revisions for a file/dir (2cp)
Related
Tickets:
#5037Closed #182. Branch 42cc_5037.
Building the entire list of commits for a path before applying paging could get us into trouble with large repos (we do have some where such things have been an issue in the past).
All three implementation support passing in the start rev, and Git and SVN both explicitly support a limit, while Mercurial uses generators so counting the limit manually would be fine. The start offset is a little more tricky but could still be done more efficiently inside the implementation instead of at the controller level.
Also, the Mercurial implementation appears to have been pulled from a library or something, as there is a fair amount of unused options and code (all of
getrenamed
andprep
could be removed). Please clean that up.Finally, this has gotten out of date with the current master and there are some small merge conflicts, if you could resolve those as well.
If we are re-using code from elsewhere, we need to track the license and original location of that.
Created #202: [#5037] View revisions for a file/dir optimization (2cp)
Related
Tickets:
#5037Closed #202. Branch
42cc_5037a
.We've resolved merge conflicts with master and changed code to handle limiting commits inside the SCM implementation where it is possible.
Also Mercurial implementation was cleaned up (for inspiration we've looked on the mercurials code itself, third-party libraries were not involved)
Got the following error when trying to view history of a file or path in Hg:
It appears to have to do with using full paths:
Created #209: [#5037] Full path in hg commits raises exception (1cp)
Related
Tickets:
#5037I see two possibilities here:
We can just cut all slashes at the beginning of the path and assume that resulting path is relative to the repo root. (thus even if path doesn't exist inside the repo, we'll get page with no commits, instead of 500 error)
Or we can detect full path that starts with repo root and handle it properly.
However, I doubt that we need a second option. It seems to me that all links to history that I can reach from the UI are using relative paths to the repo root.
How did you navigate to page with that error?
I can reproduce that only when passing
?path=//some/path
by hand.I had a repo with one file and one subdir,
foo
, with one file in it. I browsed to the subdir normally, then clicked the History button, which gave me the path fragment?path=/foo
which gave that error. I get the error when viewing the history of any path on my mercurial repo.I think assuming the path is relative to the Hg repository is reasonable, though we should also gracefully handle errors from the
hg
call.Closed #209. Branch
42cc_5037b
Originally by: jacobsen
It seems you're working on this, but I still +1'd it. Getting a display that lets you see the changes to a single file (e.g. http://jmri.svn.sourceforge.net/viewvc/jmri/trunk/jmri/java/src/jmri/jmrix/AbstractMRTrafficController.java?view=log which is a link to the functionality in our pre-update SVN) is how we in the JMRI project figure out who to involve when something regresses in released software. With lots of developers and lots of commits and lots of releases, the complexity is just overwhelming without a way to look at the history in this form.