Re: [viewvc-dev] Making repos URL obvious in ViewVC.
"C. Michael Pilato" <[email protected]>
| Newsgroups | gmane.comp.version-control.cvs.viewcvs.devel |
|---|---|
| Organization | CollabNet, Inc. |
| Message-ID | <[email protected]> |
Karl Fogel wrote:
> It would be nice if ViewVC would show how to actually check out a copy
> of the tree one is browsing. I've often been frustrated that it
> doesn't.
>
> There's no necessary relationship between the ViewVC URLs and the
> actual repository URLs -- heck, the repository might even be svn://
> instead of http:// -- but viewvc.conf could offer options to map
> repositories to their URLs. It could take advantage of the fact that
> it already knows their filesystem paths to do some kind of conditional
> mapping to URLs; this would be generally useful because there is often
> a correlation between the two (due to the SVNParentPath directive, for
> example).
>
> Beyond that hand-wavy idea, I'm not sure where to go with this. I
> don't have a patch or a design ready. But I thought I'd mention the
> idea here, in case others have had the same frustration. Maybe
> somebody who knows more about ViewVC can easily do something about
> this. Below is a forwarded mail from the Subversion users@ list,
> showing another person who also clearly could have used a way to
> convert a ViewVC URL into a repository URL.
>
> -Karl
Karl, you can do this kind of thing already by simply modifying the
templates. For example, you might tweak templates/include/dir_header.ezt to
contain text something like this:
<p>You can checkout a copy of the directory you are current viewing by
doing the following:</p>
<blockquote><pre>
svn co http://svn.collab.net/repos/[rootname][if-any where]/[where][end]
</pre></blockquote>
In the "my repository URLs don't map very easily to their disk location"
case, I admit that the EZT language won't be quite as graceful as having
some kind of custom configury magic in viewvc.conf. But what you wish to do
should still be doable in any case.
For kicks, I quickly added a "Checkout URL" row to the headers on the ViewVC
instance at http://svn.collab.net/viewvc/svn. I did so with the following
EZT stuffs:
[define checkout_url]http://svn.collab.net/repos/[rootname][if-any
where]/[where]/[end][end]
<tr>
<td>Checkout URL</td>
<td><a href="[checkout_url]">[checkout_url]</a></td>
</tr>
Maybe you could do the same in the places you need this information?
--
C. Michael Pilato <[email protected]>
CollabNet <> www.collab.net <> Distributed Development On Demand
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHG7FkokEGqRcG/W4RAuHGAKDDcPGxUcuHY1l/UF0yADe/aeWm3wCgrQAS MPTT0D+TAzRjdFZhhFDXhig= =Zqsp -----END PGP SIGNATURE-----