comparison hgext/bookmarks.py @ 9053:6d0b5d76e76d

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