comparison hgext/bookmarks.py @ 9251:6bddba3973bc

bookmarks: wrap docstrings at 70 characters
author Martin Geisler <mg@lazybytes.net>
date Sun, 26 Jul 2009 01:38:22 +0200
parents 82de0bb056d7
children f9087eea293a
comparison
equal deleted inserted replaced
9250:00986b9ed649 9251:6bddba3973bc
5 # This software may be used and distributed according to the terms of the 5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2, incorporated herein by reference. 6 # GNU General Public License version 2, incorporated herein by reference.
7 7
8 '''track a line of development with movable markers 8 '''track a line of development with movable markers
9 9
10 Bookmarks are local movable markers to changesets. Every bookmark points to a 10 Bookmarks are local movable markers to changesets. Every bookmark
11 changeset identified by its hash. If you commit a changeset that is based on a 11 points to a changeset identified by its hash. If you commit a
12 changeset that has a bookmark on it, the bookmark shifts to the new changeset. 12 changeset that is based on a changeset that has a bookmark on it, the
13 13 bookmark shifts to the new changeset.
14 It is possible to use bookmark names in every revision lookup (e.g. hg merge, 14
15 hg update). 15 It is possible to use bookmark names in every revision lookup (e.g. hg
16 16 merge, hg update).
17 By default, when several bookmarks point to the same changeset, they will all 17
18 move forward together. It is possible to obtain a more git-like experience by 18 By default, when several bookmarks point to the same changeset, they
19 adding the following configuration option to your .hgrc:: 19 will all move forward together. It is possible to obtain a more
20 git-like experience by adding the following configuration option to
21 your .hgrc::
20 22
21 [bookmarks] 23 [bookmarks]
22 track.current = True 24 track.current = True
23 25
24 This will cause Mercurial to track the bookmark that you are currently using, 26 This will cause Mercurial to track the bookmark that you are currently
25 and only update it. This is similar to git's approach to branching. 27 using, and only update it. This is similar to git's approach to
28 branching.
26 ''' 29 '''
27 30
28 from mercurial.i18n import _ 31 from mercurial.i18n import _
29 from mercurial.node import nullid, nullrev, hex, short 32 from mercurial.node import nullid, nullrev, hex, short
30 from mercurial import util, commands, localrepo, repair, extensions 33 from mercurial import util, commands, localrepo, repair, extensions
119 repo._bookmarkcurrent = mark 122 repo._bookmarkcurrent = mark
120 123
121 def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False, rename=None): 124 def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False, rename=None):
122 '''track a line of development with movable markers 125 '''track a line of development with movable markers
123 126
124 Bookmarks are pointers to certain commits that move when committing. 127 Bookmarks are pointers to certain commits that move when
125 Bookmarks are local. They can be renamed, copied and deleted. It is 128 committing. Bookmarks are local. They can be renamed, copied and
126 possible to use bookmark names in 'hg merge' and 'hg update' to merge and 129 deleted. It is possible to use bookmark names in 'hg merge' and
127 update respectively to a given bookmark. 130 'hg update' to merge and update respectively to a given bookmark.
128 131
129 You can use 'hg bookmark NAME' to set a bookmark on the working 132 You can use 'hg bookmark NAME' to set a bookmark on the working
130 directory's parent revision with the given name. If you specify a revision 133 directory's parent revision with the given name. If you specify
131 using -r REV (where REV may be an existing bookmark), the bookmark is 134 a revision using -r REV (where REV may be an existing bookmark),
132 assigned to that revision. 135 the bookmark is assigned to that revision.
133 ''' 136 '''
134 hexfn = ui.debugflag and hex or short 137 hexfn = ui.debugflag and hex or short
135 marks = parse(repo) 138 marks = parse(repo)
136 cur = repo.changectx('.').node() 139 cur = repo.changectx('.').node()
137 140