Commit 24bfb5c7 authored by Anton Shestakov's avatar Anton Shestakov
Browse files

next: filter unstable targets by topic only when there's no --no-topic

Otherwise --no-topic makes no difference in how hg next works with unstable
targets.

Now that aspchildren filtering code actually works, this patch makes hg next
behave correctly when dealing with unstable changesets with a different topic.
parent 1d8148795dc2
......@@ -856,7 +856,7 @@
# check if we need to evolve while updating to the next child revision
needevolve = False
aspchildren = evolvecmd._aspiringchildren(repo, [repo[b'.'].rev()])
if topic:
if topic and not opts['no_topic']:
filtered.update(rev for rev in aspchildren
if repo[rev].topic() != topic)
aspchildren = [rev for rev in aspchildren if rev not in filtered]
......
......@@ -35,7 +35,7 @@
$ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
$ wc -l files
348 files
349 files
$ fgrep debian files
tests/test-check-debian.t
$ fgrep __init__.py files
......
$ . "$TESTDIR/testlib/topic_setup.sh"
$ . "$TESTDIR/testlib/common.sh"
$ cat << EOF >> $HGRCPATH
> [extensions]
> evolve =
> [ui]
> logtemplate = '{rev} [{topic}] {desc}\n'
> EOF
Making sure plain hg next sticks to topic when target is unstable
$ hg init next-unstable-topic
$ cd next-unstable-topic
$ mkcommit ROOT
$ hg topics topic-a
marked working directory as topic: topic-a
$ mkcommit A
active topic 'topic-a' grew its first changeset
(see 'hg help topics' for more information)
$ hg topics topic-b
$ mkcommit B
active topic 'topic-b' grew its first changeset
(see 'hg help topics' for more information)
$ hg up 'topic("topic-a")'
switching to topic topic-a
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo foo > foo
$ hg ci -A --amend
adding foo
1 new orphan changesets
$ hg log -G
@ 3 [topic-a] A
|
| * 2 [topic-b] B
| |
| x 1 [topic-a] A
|/
o 0 [] ROOT
$ hg next
no children on topic "topic-a"
do you want --no-topic
[1]
$ hg next --no-topic
move:[2] B
atop:[3] A
working directory is now at 53f8332d648f
$ cd ..
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment