tests/test-revset-dirstate-parents.t
author Martin von Zweigbergk <martinvonz@google.com>
Sun, 23 Nov 2014 14:09:10 -0800
changeset 23473 922b10c870c5
parent 16913 f2719b387380
child 24458 7d87f672d069
permissions -rw-r--r--
merge: branch code into {n1 and n2, n1, n2} top-level cases There are three high-level cases that are of interest in manifestmerge(): 1) The file exists on both sides, 2) The file exists only on the local side, and 3) The file exists only on the remote side. Let's make this clearer in the code. The 'if f in copied' case will be broken up into the two applicable branches in the next patch.

  $ HGENCODING=utf-8
  $ export HGENCODING

  $ try() {
  >   hg debugrevspec --debug $@
  > }

  $ log() {
  >   hg log --template '{rev}\n' -r "$1"
  > }

  $ hg init repo
  $ cd repo

  $ try 'p1()'
  (func
    ('symbol', 'p1')
    None)
  $ try 'p2()'
  (func
    ('symbol', 'p2')
    None)
  $ try 'parents()'
  (func
    ('symbol', 'parents')
    None)

null revision
  $ log 'p1()'
  $ log 'p2()'
  $ log 'parents()'

working dir with a single parent
  $ echo a > a
  $ hg ci -Aqm0
  $ log 'p1()'
  0
  $ log 'tag() and p1()'
  $ log 'p2()'
  $ log 'parents()'
  0
  $ log 'tag() and parents()'

merge in progress
  $ echo b > b
  $ hg ci -Aqm1
  $ hg up -q 0
  $ echo c > c
  $ hg ci -Aqm2
  $ hg merge -q
  $ log 'p1()'
  2
  $ log 'p2()'
  1
  $ log 'tag() and p2()'
  $ log 'parents()'
  1
  2

  $ cd ..