Commit Graph

21 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
1430646025 update: omit redundant activating message for already active bookmark
This patch also adds "hg bookmarks" invocation into tests, where
redundant message is omitted but bookmark activity isn't clear from
context.
2016-03-12 04:35:42 +09:00
FUJIWARA Katsunori
9edf9953ec destutil: choose non-closed branch head at first (BC)
Before this patch, destupdate() returns the tipmost (descendant)
branch head regardless of closed or not. But updating to closed branch
head isn't reasonable for ordinary workflow, because:

  - "hg heads" doesn't show closed heads (= updated parent itself) by
    default

  - subsequent committing on it re-opens closed branch

    even if inactivation of closed head is needed, update destination
    isn't it, because it should be merged into to another branch in
    such case.

This patch chooses non-closed descendant branch head as default update
destination at first. If all descendant branch heads are closed,
destupdate() returns the tipmost closed branch head.

For simplicity, this patch chooses adding _destupdatebranchfallback()
instead largely changing _destupdatebranch().

This patch changes not only normal lookup code path, but also the "no
default branch" code path, for consistency.
2016-03-07 03:14:19 +09:00
Ryan McElroy
9fa69b0d75 templatekw: display active bookmark more consistently (issue4552) (BC)
Previously, the template keyword '{activebookmark}' would only display the
active bookmark if it was also pointing to the working directory's parent.
Meanwhile, the '{active}' subkeyword of the '{bookmarks}' keyword displays
the active bookmark regardless of whether it also points to the working
directory's parent. This is confusing.

Consider the output of these two templates:

  $ hg log -T '{activebookmark}\n' -r indent

  $ hg log -T '{bookmarks % "{bookmark}"}\n' -r indent
  indent

This is the current behavior that can arise after, eg, a pull moves a bookmark
out from under you. After this patch, the first template will also return the
active bookmark that points to a revision, even if it is not the current
parent of the working directory. A test has been added to show the new behavior.
2015-04-15 09:07:54 -07:00
Ryan McElroy
f73efddf9c commands: rename current to active in variables and comments
Today, the terms 'active' and 'current' are interchangeably used throughout the
codebase in reference to the active bookmark (the bookmark that will be updated
with the next commit). This leads to confusion among developers and users.
This patch is part of a series to standardize the usage to 'active' throughout
the mercurial codebase and user interface.
2015-05-28 20:06:19 -07:00
Yuya Nishihara
9ea06d6a89 bookmarks: split ui.write() so that it can be easily ported to formatter api
Test output changes because color labels are applied separately.
2014-10-03 00:36:36 +09:00
Stephen Lee
767b0ab60c update: show message when a bookmark is activated by update
When updating to a bookmark, mention that the bookmark is now
active.  This is a reminder that update does not move the
current bookmark if an explicit target is given - instead
it activates that target.
2013-03-07 14:17:56 +11:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Kevin Bullock
21ed6a41e7 bookmarks: allow bookmark command to take multiple arguments
This change allows setting or deleting multiple bookmarks at once. If more than
one is being set and --inactive is not given, the first one is made active.
2013-05-02 21:28:18 -05:00
Sean Farley
a7c7655a58 bookmarks: fix bug that activated a bookmark even with -r passed
If the current revision was the target revision of -r, then the bookmark would
be active. Test cases have been updated accordingly.
2013-05-01 15:24:21 -05:00
Sean Farley
3561df94aa bookmarks: resolve divergent bookmarks when moving active bookmark forward
This patch resolves divergent bookmarks between the current active bookmark
MARK and the new destination. This situation can arise when pulling new
changesets, abandoning your current changesets actively bookmarked with MARK
via strip, and then doing a bare update. The non-divergent but active bookmark
MARK is then moved to a common ancestor of the new changesets and the abandoned
changesets.

Test coverage is added.
2013-05-01 15:34:45 -05:00
Kevin Bullock
564144c8dd bookmarks: deactivate current bookmark if no name is given
a0d2da57b726 added this help text to hg bookmark:

  If no NAME is given, the current active bookmark will be marked inactive.

But that was never actually the case.

Originally spotted by Idan Kamara <idankk86@gmail.com>.
2012-10-08 00:19:30 +02:00
Kevin Bullock
a4f03c7e07 bookmarks: test that bare update forwards active bookmark 2012-05-05 15:12:26 -05:00
Idan Kamara
263be8e6a2 update: delete bookmarks.current when explicitly updating to a rev (issue3276) 2012-02-28 23:47:46 +02:00
Kevin Bullock
c38d0cc58b bookmarks: allow deactivating current bookmark with -i 2011-05-04 10:43:47 -05:00
Kevin Bullock
b95625191f bookmarks: allow to create/move bookmark without making it current (issue2788)
Adds a -i/--inactive flag to the bookmarks command to create or move a
bookmark without making it the current one. This lets you use a bookmark
like a shareable, movable 'tag' and less like a 'branch'.

Thanks to Alexander Solovyov <alexander@solovyov.net> for most of the
work of implementation, and Matt Mackall <mpm@selenic.com> for
suggesting the option name.
2010-12-11 18:08:55 +01:00
Benoit Boissinot
bd2935644e bookmarks: fix update of the current bookmark during rename
We need to get rid of the previous bookmark after changing current bookmark.
2011-03-13 15:42:24 +01:00
David Soria Parra
6b3204aa84 tests: remove bookmark extension configuration 2011-02-24 03:13:48 +01:00
Augie Fackler
20e4786913 bookmarks: verify switching bookmarks works properly 2011-02-16 17:36:31 -06:00
David Soria Parra
12aa64e430 bookmarks: make track.current=True default behaviour and remove option (BC) 2011-02-16 01:29:26 +01:00
Mads Kiilerich
635406bf76 tests: use (esc) for all non-ASCII test output 2010-11-08 01:41:41 +01:00
Martin Geisler
76232dcc21 tests: unify test-bookmarks-current 2010-08-14 02:58:34 +02:00