tests/test-topic-shelve.t
author Anton Shestakov <av6@dwimlabs.net>
Tue, 28 Aug 2018 21:28:41 +0800
changeset 4044 c0fbe70f2e48
parent 3769 1bc4b0807c37
child 4067 fb4801478d5d
permissions -rw-r--r--
topic: check that repo.currenttopic is set before using it as an argument repo.currenttopic can be an empty string, which means there's no current topic set. This fact can be used to short-circuit some checks. Also, this avoids passing an empty string as an argument to topic() revset.

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)