tests/test-topic-shelve.t
author Denis Laxalde <denis.laxalde@logilab.fr>
Wed, 23 May 2018 11:37:37 +0200
changeset 3769 1bc4b0807c37
parent 3060 f43a310c4338
child 4067 fb4801478d5d
permissions -rw-r--r--
topic: display a hint pointing at help when a topic becomes non-empty This is an attempt at avoiding "mistakes" by new users of topics when they pull a topic and publish its changesets while being checked out. In this case, the topic will become empty but still be active; however, if this is a "foreign" topic, the user will not likely want to keep it active for the next commit operation. So we add a hint message pointing at general help of "topics" command so that they can eventually do something and learn about "hg topics --clear".

testing topic with shelve extension
------------------------------------

  $ . "$TESTDIR/testlib/topic_setup.sh"

  $ hg init repo
  $ cd repo
  $ cat <<EOF >>.hg/hgrc
  > [extensions]
  > shelve=
  > EOF

  $ touch a
  $ echo "Hello" >> a
  $ hg topic "testing-shelve"
  marked working directory as topic: testing-shelve
  $ hg topic
   * testing-shelve (0 changesets)
  $ hg ci -m "First commit" -A
  adding a
  active topic 'testing-shelve' grew its first changeset
  (see 'hg help topics' for more information)
  $ hg topic
   * testing-shelve (1 changesets)
  $ echo " World" >> a
  $ hg stack
  ### topic: testing-shelve
  ### target: default (branch)
  t1@ First commit (current)

shelve test
-----------

  $ hg shelve
  shelved as default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg topic
   * testing-shelve (1 changesets)
  $ hg stack
  ### topic: testing-shelve
  ### target: default (branch)
  t1@ First commit (current)

unshelve test
-------------
  $ hg unshelve
  unshelving change 'default'
  $ hg topic
   * testing-shelve (1 changesets)
  $ hg stack
  ### topic: testing-shelve
  ### target: default (branch)
  t1@ First commit (current)