Modify ↓
Opened 8 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): 128 128 reponame = '' 129 129 repos = rm.get_repository(reponame) 130 130 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.", 132 134 repo=reponame or '(default)')) 133 135 if rev is not None: 134 136 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)
Note:
See TracTickets
for help on using tickets.