tests/test-drawdag.t
author Jun Wu <quark@fb.com>
Tue, 05 Sep 2017 13:37:36 -0700
changeset 34087 5361771f9714
parent 33788 0531ffd59a98
child 34198 402efa8421b8
permissions -rw-r--r--
wrapfunction: use functools.partial if possible Every `extensions.bind` call inserts a frame in traceback: ... in closure return func(*(args + a), **kw) which makes traceback noisy. The Python stdlib has a `functools.partial` which is backed by C code and does not pollute traceback. However it does not support instancemethod and sets `args` attribute which could be problematic for alias handling. This patch makes `wrapfunction` use `functools.partial` if we are wrapping a function directly exported by a module (so it's impossible to be a class or instance method), and special handles `wrapfunction` results so alias handling code could handle `args` just fine. As an example, `hg rebase -s . -d . --traceback` got 6 lines removed in my setup: File "hg/mercurial/dispatch.py", line 898, in _dispatch cmdpats, cmdoptions) -File "hg/mercurial/extensions.py", line 333, in closure - return func(*(args + a), **kw) File "hg/hgext/journal.py", line 84, in runcommand return orig(lui, repo, cmd, fullargs, *args) -File "hg/mercurial/extensions.py", line 333, in closure - return func(*(args + a), **kw) File "fb-hgext/hgext3rd/fbamend/hiddenoverride.py", line 119, in runcommand result = orig(lui, repo, cmd, fullargs, *args) File "hg/mercurial/dispatch.py", line 660, in runcommand ret = _runcommand(ui, options, cmd, d) -File "hg/mercurial/extensions.py", line 333, in closure - return func(*(args + a), **kw) File "hg/hgext/pager.py", line 69, in pagecmd return orig(ui, options, cmd, cmdfunc) .... Differential Revision: https://phab.mercurial-scm.org/D632
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33152
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH<<EOF
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     2
  > [extensions]
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     3
  > drawdag=$TESTDIR/drawdag.py
33153
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
     4
  > [experimental]
33773
6c1a9fd8361b test: update evolution config
Boris Feld <boris.feld@octobus.net>
parents: 33558
diff changeset
     5
  > stabilization=all
33152
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     6
  > EOF
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     7
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     8
  $ reinit () {
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
     9
  >   rm -rf .hg && hg init
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    10
  > }
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    11
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    12
  $ hg init
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    13
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    14
Test what said in drawdag.py docstring
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    15
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    16
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    17
  > c d
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    18
  > |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    19
  > b
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    20
  > |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    21
  > a
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    22
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    23
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    24
  $ hg log -G -T '{rev} {desc} ({tags})'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    25
  o  3 d (d tip)
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    26
  |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    27
  | o  2 c (c)
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    28
  |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    29
  o  1 b (b)
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    30
  |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    31
  o  0 a (a)
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    32
  
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    33
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    34
  >  foo    bar       bar  foo
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    35
  >   |     /          |    |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    36
  >  ancestor(c,d)     a   baz
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    37
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    38
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    39
  $ hg log -G -T '{desc}'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    40
  o    foo
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    41
  |\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    42
  +---o  bar
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    43
  | | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    44
  | o |  baz
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    45
  |  /
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    46
  +---o  d
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    47
  | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    48
  +---o  c
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    49
  | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    50
  o |  b
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    51
  |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    52
  o  a
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    53
  
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    54
  $ reinit
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    55
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    56
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    57
  > o    foo
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    58
  > |\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    59
  > +---o  bar
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    60
  > | | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    61
  > | o |  baz
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    62
  > |  /
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    63
  > +---o  d
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    64
  > | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    65
  > +---o  c
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    66
  > | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    67
  > o |  b
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    68
  > |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    69
  > o  a
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    70
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    71
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    72
  $ hg log -G -T '{desc}'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    73
  o    foo
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    74
  |\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    75
  | | o  d
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    76
  | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    77
  | | o  c
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    78
  | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    79
  | | o  bar
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    80
  | |/|
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    81
  | o |  b
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    82
  | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    83
  o /  baz
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    84
   /
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    85
  o  a
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    86
  
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    87
  $ reinit
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    88
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    89
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    90
  > o    foo
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    91
  > |\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    92
  > | | o  d
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    93
  > | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    94
  > | | o  c
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    95
  > | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    96
  > | | o  bar
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    97
  > | |/|
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    98
  > | o |  b
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
    99
  > | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   100
  > o /  baz
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   101
  >  /
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   102
  > o  a
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   103
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   104
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   105
  $ hg log -G -T '{desc}'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   106
  o    foo
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   107
  |\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   108
  | | o  d
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   109
  | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   110
  | | o  c
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   111
  | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   112
  | | o  bar
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   113
  | |/|
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   114
  | o |  b
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   115
  | |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   116
  o /  baz
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   117
   /
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   118
  o  a
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   119
  
33558
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   120
  $ hg manifest -r a
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   121
  a
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   122
  $ hg manifest -r b
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   123
  a
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   124
  b
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   125
  $ hg manifest -r bar
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   126
  a
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   127
  b
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   128
  $ hg manifest -r foo
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   129
  a
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   130
  b
0103e7187237 drawdag: include files from both parents in merge commits
Martin von Zweigbergk <martinvonz@google.com>
parents: 33153
diff changeset
   131
  baz
33152
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   132
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   133
Edges existed in repo are no-ops
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   134
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   135
  $ reinit
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   136
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   137
  > B C C
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   138
  > | | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   139
  > A A B
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   140
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   141
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   142
  $ hg log -G -T '{desc}'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   143
  o    C
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   144
  |\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   145
  | o  B
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   146
  |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   147
  o  A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   148
  
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   149
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   150
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   151
  > C D C
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   152
  > | | |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   153
  > B B A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   154
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   155
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   156
  $ hg log -G -T '{desc}'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   157
  o  D
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   158
  |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   159
  | o  C
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   160
  |/|
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   161
  o |  B
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   162
  |/
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   163
  o  A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   164
  
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   165
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   166
Node with more than 2 parents are disallowed
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   167
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   168
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   169
  >   A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   170
  >  /|\
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   171
  > D B C
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   172
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   173
  abort: A: too many parents: C D B
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   174
  [255]
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   175
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   176
Cycles are disallowed
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   177
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   178
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   179
  > A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   180
  > |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   181
  > A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   182
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   183
  abort: the graph has cycles
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   184
  [255]
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   185
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   186
  $ hg debugdrawdag <<'EOS'
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   187
  > A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   188
  > |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   189
  > B
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   190
  > |
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   191
  > A
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   192
  > EOS
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   193
  abort: the graph has cycles
367a3c6473d2 test-drawdag: add a test for drawdag.py
Jun Wu <quark@fb.com>
parents:
diff changeset
   194
  [255]
33153
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   195
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   196
Create obsmarkers via comments
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   197
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   198
  $ reinit
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   199
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   200
  $ hg debugdrawdag <<'EOS'
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   201
  >       G
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   202
  >       |
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   203
  > I D C F   # split: B -> E, F, G
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   204
  >  \ \| |   # replace: C -> D -> H
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   205
  >   H B E   # prune: F, I
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   206
  >    \|/
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   207
  >     A
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   208
  > EOS
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   209
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   210
  $ hg log -r 'sort(all(), topo)' -G --hidden -T '{desc} {node}'
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   211
  o  G 711f53bbef0bebd12eb6f0511d5e2e998b984846
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   212
  |
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   213
  x  F 64a8289d249234b9886244d379f15e6b650b28e3
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   214
  |
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   215
  o  E 7fb047a69f220c21711122dfd94305a9efb60cba
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   216
  |
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   217
  | x  D be0ef73c17ade3fc89dc41701eb9fc3a91b58282
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   218
  | |
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   219
  | | x  C 26805aba1e600a82e93661149f2313866a221a7b
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   220
  | |/
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   221
  | x  B 112478962961147124edd43549aedd1a335e44bf
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   222
  |/
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   223
  | x  I 58e6b987bf7045fcd9c54f496396ca1d1fc81047
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   224
  | |
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   225
  | o  H 575c4b5ec114d64b681d33f8792853568bfb2b2c
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   226
  |/
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   227
  o  A 426bada5c67598ca65036d57d9e4b64b0c1ce7a0
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   228
  
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   229
  $ hg debugobsolete
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   230
  112478962961147124edd43549aedd1a335e44bf 7fb047a69f220c21711122dfd94305a9efb60cba 64a8289d249234b9886244d379f15e6b650b28e3 711f53bbef0bebd12eb6f0511d5e2e998b984846 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   231
  26805aba1e600a82e93661149f2313866a221a7b be0ef73c17ade3fc89dc41701eb9fc3a91b58282 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   232
  be0ef73c17ade3fc89dc41701eb9fc3a91b58282 575c4b5ec114d64b681d33f8792853568bfb2b2c 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   233
  64a8289d249234b9886244d379f15e6b650b28e3 0 {7fb047a69f220c21711122dfd94305a9efb60cba} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
4d780d510b44 drawdag: support obsmarker creation in comments
Jun Wu <quark@fb.com>
parents: 33152
diff changeset
   234
  58e6b987bf7045fcd9c54f496396ca1d1fc81047 0 {575c4b5ec114d64b681d33f8792853568bfb2b2c} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
33788
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   235
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   236
Change file contents via comments
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   237
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   238
  $ reinit
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   239
  $ hg debugdrawdag <<'EOS'
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   240
  > C       # A/dir1/a = 1\n2
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   241
  > |\      # B/dir2/b = 34
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   242
  > A B     # C/dir1/c = 5
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   243
  >         # C/dir2/c = 6
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   244
  >         # C/A = a
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   245
  >         # C/B = b
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   246
  > EOS
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   247
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   248
  $ hg log -G -T '{desc} {files}'
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   249
  o    C A B dir1/c dir2/c
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   250
  |\
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   251
  | o  B B dir2/b
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   252
  |
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   253
  o  A A dir1/a
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   254
  
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   255
  $ for f in `hg files -r C`; do
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   256
  >   echo FILE "$f"
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   257
  >   hg cat -r C "$f"
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   258
  >   echo
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   259
  > done
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   260
  FILE A
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   261
  a
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   262
  FILE B
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   263
  b
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   264
  FILE dir1/a
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   265
  1
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   266
  2
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   267
  FILE dir1/c
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   268
  5
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   269
  FILE dir2/b
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   270
  34
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   271
  FILE dir2/c
0531ffd59a98 drawdag: allow override file contents via comments
Jun Wu <quark@fb.com>
parents: 33773
diff changeset
   272
  6