Bug #9

Mercurial repository not created

Added by Redmine Admin almost 14 years ago. Updated over 13 years ago.

Status:ClosedStart date:2010-09-10
Priority:NormalDue date:
Assignee:Chris Cannam% Done:


Target version:-


... for new project.


#1 Updated by Chris Cannam over 13 years ago

(See also https://code.soundsoftware.ac.uk/projects/soundsoftware-site/wiki/AuthenticatingHg)

In principle, it would probably be nice for the user who creates or administrates the project to get to choose the repository name. Rather than just creating a repo for every project, even if it's not needed, it might be better if the user could set the repo path in Redmine, and reposman would then check whether the repo existed and create it if it did not. Redmine does happily allow you to set a repository path to something that doesn't exist yet -- though the error message from the repository view tab subsequently is not very helpful (and is SCM-specific).

A big problem with that and with the current working of reposman is that the user who creates the project doesn't typically know what repository path to use. For example, a user has just created a project on our test site and typed in "/projects/X/repository" (where X is project name) as the repos path, presumably guessing from the public URL for the browse page. We should either:

  1. set a sensible repository path for every project on creation (and create the repository automatically)
  2. pre-populate the repository path entry field with an appropriate value or prefix
  3. provide documentation in the repository settings page
  4. check the repository path in reposman and correct it if it is implausible (i.e. if it is a local path that is not in /var/hg or whatever)

There are also security concerns here -- we don't want anyone to be able to set their project's repository URL to that of a different project on the server that they wouldn't normally be able to see; we don't want people to be able to grab URLs that other projects in future might want; and we don't want people setting arbitrary filesystem paths as the repository URL (won't work unless the version control system can read the repo, but even so!)

#2 Updated by Chris Cannam over 13 years ago

... so, maybe the real solution is:

  • give people a choice of local or remote repository URL
  • default to local, with same name as project, and create the repo automatically when the project is created
  • if the repository is local, prevent them from editing it; require it to have the same name as the project (pity -- and how does this interact with subprojects? do we want project+subproject as the repo name or some such?)
  • if the repository is remote, allow them to edit it but don't permit local URLs

#3 Updated by Chris Cannam over 13 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Ah, I hadn't actually realised that "raw" Redmine won't track a remote repository anyway. Any URL entered by the user has to be local. That simplifies matters, at least until we come to try to improve on that aspect...

So, in 12420e46bed9 we make the URL field totally non-user-editable, so that it always has to be populated by reposman. We also have our own custom version of reposman from this commit with our logic baked in -- though in fact in this more limited than expected scenario, the bundled reposman would (I think) do just as well.

Also added informational message in 192d132064a5 so that the user knows what's going on.

Finally, added a cron job running our custom reposman every five minutes.

Also available in: Atom PDF