tests/test-evolve-issue5881.t
author Sushil khanchi <sushilkhanchi97@gmail.com>
Mon, 01 Jul 2019 19:15:57 +0530
branchstable
changeset 4702 fcecbb1261f2
parent 4577 bcd52ce0916d
child 4675 79bc0f1a832e
permissions -rw-r--r--
evolve: fix the inconsistent behaviour of prune (issue6137) Let's not update to any revision when working directory parent is not related to the revision being pruned. Changes in test file demonstrate the fixed behaviour.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4346
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     1
Test for issue 5881 present at https://bz.mercurial-scm.org/show_bug.cgi?id=5881
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     2
===============================================================================
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     3
which is about that if the working copy parent  is obsolete then evolve update
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     4
to its successor revision and stop; it doesn't continue to evolve remaining
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     5
revisions those were suppossed to evovle.
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     6
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     7
Setup
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     8
=====
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
     9
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    10
  $ cat >> $HGRCPATH <<EOF
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    11
  > [phases]
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    12
  > publish = False
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    13
  > [alias]
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    14
  > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    15
  > [extensions]
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    16
  > EOF
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    17
  $ echo "evolve=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/" >> $HGRCPATH
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    18
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    19
  $ hg init issue5881
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    20
  $ cd issue5881
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    21
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    22
Prepare the directory by creating an orphan and update to its obsolete parent:
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    23
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    24
  $ for ch in a b c; do echo $ch > $ch; hg ci -Am "added "$ch; done;
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    25
  adding a
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    26
  adding b
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    27
  adding c
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    28
  $ hg up 1 -q
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    29
  $ hg ci --amend -m "updated b"
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    30
  1 new orphan changesets
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    31
  $ hg up 1
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    32
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    33
  working directory parent is obsolete! (5f6d8a4bf34a)
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    34
  (use 'hg evolve' to update to its successor: e6048a693c0d)
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    35
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    36
  $ hg glog
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    37
  o  3:e6048a693c0d updated b
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    38
  |   () draft
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    39
  | *  2:155349b645be added c
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    40
  | |   () draft
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    41
  | @  1:5f6d8a4bf34a added b
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    42
  |/    () draft
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    43
  o  0:9092f1db7931 added a
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    44
      () draft
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    45
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    46
Test `hg evolve` evolve all the revisions specified by user:
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    47
  $ hg evolve -r .::
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    48
  update:[3] updated b
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    49
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
ff483949674e evolve: add test case for issue 5881
Sushil khanchi <sushilkhanchi97@gmail.com>
parents:
diff changeset
    50
  working directory is now at e6048a693c0d
4348
398c33b17d76 evolve: make sure we don't stop after evolution of obsparent (issue5881)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4346
diff changeset
    51
  move:[2] added c
398c33b17d76 evolve: make sure we don't stop after evolution of obsparent (issue5881)
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 4346
diff changeset
    52
  atop:[3] updated b
4577
bcd52ce0916d evolve: don't update after instability resolution by default (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 4348
diff changeset
    53
  working directory is now at e6048a693c0d