Proposal for namespaced bookmarks
Victor Suba
vosuba at gmail.com
Sat Nov 12 23:00:33 CST 2011
Hi,
I'd like to propose a multi-step plan for enabling namespaced bookmarks.
The first proposals are some extra "paths" functionality to help make
sure remote path aliases are available to use, but even in itself the
new "paths" functionality may be useful.
1) Add per-repository paths stored in the repo that can be operated on via
"hg paths"
command while keeping compatibility with the "hgrc" paths
configurations.
Add .hg/paths file for storing list of path NAME URL pairs.
New commands (in addition to current "paths" functionality):
hg paths [-f] [-d] [-m NAME] [NAME] [URL]
-f --force force
-d --delete delete a given path alias
-m --rename NAME rename a given path alias
You can use "hg paths NAME URL" to create the path alias NAME to the
URL. Add -f to force change an existing path alias.
To delete a path alias use "hg -d NAME".
To modify an existing path alias use "hg -m CURRENT_NAME NEW_NAME".
Paths already defined in local or global "hgrc" files can't be
changed or deleted
via these commands, and "hgrc" paths take priority over .hg/paths.
2) Make path alias available as a namespace for bookmarks when
cloned/pulled from
a remote repo.
If a URL is directly used in clone or pull or push, all paths are
reverse checked
for a match to get the matching path alias.
If no existing paths are matched, a unique alias is assigned of the form
"remote<N>" and saved automatically in .hg/paths, thereby repeated use
of a URL
will map to the same alias, which will be visible in "hg paths".
Whenever a path in "hgrc" is used, the path is also mirrored in
.hg/paths, so
a remote path alias that has been used in a command won't be forgotten
without
explicitly running "hg paths -d NAME". This gives opportunity for
hooking some
extra functionality when a remote path is deleted, such as garbage
collecting
orphaned bookmarks.
Once those are in place, think about how to apply the namespaces to
bookmarks e.g.
namespace/bookmark or bookmark at namespace. Those will come in handy in
telling
where bookmarks were pulled from, filtering in GUIs, etc.
Cheers,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111112/2aab6f8e/attachment.html>
More information about the Mercurial-devel
mailing list