Edgewall Software
Modify

Opened 7 years ago

#12687 new defect

Provide additional hints when trac-admin repository commands are not provided a valid repository name

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: next-major-releases
Component: version control Version:
Severity: normal Keywords: bitesized trac-admin
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

From reports on the MailingList and personal experience, it seems users mistakenly input "repository <path>" rather than "repository <name>" for the trac-admin repository commands:

$trac-admin tracenvs/proj-1.3 help repository
repository add <repos> <dir> [type]

    Add a source repository

repository alias <name> <target>

    Create an alias for a repository

repository list 

    List source repositories

repository remove <repos>

    Remove a source repository

repository resync <repos> [rev]

    Re-synchronize trac with repositories

repository set <repos> <key> <value>

    Set an attribute of a repository

repository sync <repos> [rev]

    Resume synchronization of repositories

We could provide additional hints, like the following:

$trac-admin tracenvs/proj-1.3 repository sync "notfound" 10
TracError: Repository "notfound" doesn't exist.

Use 'repository list' to view the valid repository names.
  • trac/versioncontrol/admin.py

    diff --git a/trac/versioncontrol/admin.py b/trac/versioncontrol/admin.py
    index 86294ac4f..0acd0e99a 100644
    a b class VersionControlAdmin(Component):  
    128128                reponame = ''
    129129            repos = rm.get_repository(reponame)
    130130            if repos is None:
    131                 raise TracError(_("Repository \"%(repo)s\" doesn't exist",
     131                raise TracError(_("Repository \"%(repo)s\" doesn't exist.\n"
     132                                  "\nUse 'repository list' to view the "
     133                                  "valid repository names.",
    132134                                  repo=reponame or '(default)'))
    133135            if rev is not None:
    134136                repos.sync_changeset(rev)

Similar changes would need to be made for the other trac-admin repository commands. Alternatively we could list the repository names when the error occurs.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.