On 6/23/2010 7:42 PM, tsuraan wrote:
In trac 0.12, a project can have multiple repositories. It seems like
the changeset:<number> links only go to the main repo though, so if
you have two repos configured, you'll only get changeset links working
with one of them. So far I've seen two places where this is a
problem: if you browse to .../changeset/<number>, it selects the
default repository for you, and gives an error if the changeset isn't
in that repository. The second place is on the wiki/tickets; a
changeset link isn't clickable if the changeset isn't in the primary
repository. I think the first problem could be fixed by having the
base changeset request handler iterate through configured repos until
it sees one where the desired changeset is present. I assume that is
done somewhere in versioncontrol/web_ui/changeset.py, but I'm not
having much luck actually finding the code that would need to be
changed. Assuming that bit can be changed, would the second part (the
dead links being replaced by no link at all) just resolve itself?
I'll be hunting around in the changeset.py code for where the default
repo is chosen, but if anybody has any better pointers, I'd love to
hear them. Thanks!
It seems you missed the intended ways to refer to changesets in the
non-default repository.
A good excuse for you is that apparently
http://trac.edgewall.org/wiki/TracLinks#VersionControlrelatedlinks lacks
a discussion of the syntax for linking to changesets...
The changeset:<number> and /changeset/<number> URLs are supposed to be
fully backward compatible with pre-existing 0.11 environments. If you
migrate a pre-0.12 single repository environment to 0.12, nothing has
changed (leaving aside the joy of backward incompatible changes in the
trac.versioncontrol.api, of course ;-) ). Even if you add *more*
repositories to such a pre-existing environment, the old links should
still continue to work.
When you have multiple repositories, you can unambiguously access
anything (file or changeset) using the repository name as a prefix to
the paths. Changesets support a "restricted path" syntax since 0.11 (or
even earlier?) to only show the changes below the given path
(/changeset/<number>/<path> and changeset:<number>/<path> ... and
[<number>/<path>] as well), so in the case of multiple repositories,
that path has to start with the repository name.
Now, it's true that this design mostly came from the days when we were
mainly thinking about Subversion as a backend. There, all the revisions
numbers are identical between difference repositories, but of course a
r100 in one repository has nothing in common with a r100 in another
repository, so in this case it's necessary to "qualify" which repository
one is talking about. Not so with Mercurial and Git, where you can be
reasonably confident that e.g. a changeset f1f422a1053e in one
repository would be *exactly* the same as a changeset f1f422a1053e if
that one is found in another repository (a clone for example). So yes,
in the latter case, it would make sense to be able to specify only the
changeset number and let Trac find the appropriate changeset among the
active repositories.
-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.