tests/test-rebase-templates.t
author Mark Thomas <mbthomas@fb.com>
Wed, 15 Nov 2017 01:07:42 -0800
changeset 35085 ae7ad53d3c8d
parent 34883 c858afe9c59b
child 35124 c157bb0120a9
permissions -rw-r--r--
fsmonitor: only access inner dirstate map if it is available As part of the dirstate refactor, fsmonitor was updated to directly access the inner map of the dirstatemap object. Dirstatemap reimplementations may not use a map like this, so only access it if it is there. Differential Revision: https://phab.mercurial-scm.org/D1346
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34883
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
Testing templating for rebase command
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
Setup
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     5
  $ cat >> $HGRCPATH <<EOF
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     6
  > [extensions]
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > rebase=
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > [experimental]
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > evolution=createmarkers
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  > EOF
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
  $ hg init repo
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
  $ cd repo
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
  $ for ch in a b c d; do echo foo > $ch; hg commit -Aqm "Added "$ch; done
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ hg log -G -T "{rev}:{node|short} {desc}"
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
  @  3:62615734edd5 Added d
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
  |
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
  o  2:28ad74487de9 Added c
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  |
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  o  1:29becc82797a Added b
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  |
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  o  0:18d04c59bb5d Added a
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
Getting the JSON output for nodechanges
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
  $ hg rebase -s 2 -d 0 -q -Tjson
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
  [
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
   {
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    30
    "nodechanges": {"28ad74487de9599d00d81085be739c61fc340652": ["849767420fd5519cf0026232411a943ed03cc9fb"], "62615734edd52f06b6fb9c2beb429e4fe30d57b8": ["df21b32134ba85d86bca590cbe9b8b7cbc346c53"]}
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    31
   }
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    32
  ]
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  $ hg log -G -T "{rev}:{node|short} {desc}"
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  @  5:df21b32134ba Added d
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  |
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    37
  o  4:849767420fd5 Added c
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
  |
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
  | o  1:29becc82797a Added b
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
  |/
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  o  0:18d04c59bb5d Added a
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
  
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
  $ hg rebase -s 1 -d 5 -q -T "{nodechanges|json}"
c858afe9c59b rebase: add support to output nodechanges
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
  {"29becc82797a4bc11ec8880b58eaecd2ab3e7760": ["d9d6773efc831c274eace04bc13e8e6412517139"]} (no-eol)