tests/test-uncommit.t
author Martin von Zweigbergk <martinvonz@google.com>
Fri, 15 Feb 2019 10:39:45 -0800
changeset 41750 1040d54eb7eb
parent 41745 83d294c71f1e
child 41859 bf22e370ae9a
permissions -rw-r--r--
uncommit: add config option to keep commit by default We have a Google-internal extension that keeps track of "review units" (like Phabricator reviews, or Gerrit's Change-Id). This information is stored outside of the commit. It is updated with rewrites. Every now and then we get reports from users who are confused because `hg uncommit` lost track of their review. Keeping the empty commit by default would reduce this confusion. It may also cause confusion about the empty commit. This patch adds a config option that lets us easily test both behaviors on our users. Differential Revision: https://phab.mercurial-scm.org/D5970
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     1
Test uncommit - set up the config
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     4
  > [experimental]
34866
1644623ab096 config: use 'experimental.evolution.create-markers'
Boris Feld <boris.feld@octobus.net>
parents: 34304
diff changeset
     5
  > evolution.createmarkers=True
34867
7f183c643eb6 config: use 'experimental.evolution.allowunstable'
Boris Feld <boris.feld@octobus.net>
parents: 34866
diff changeset
     6
  > evolution.allowunstable=True
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     7
  > [extensions]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     8
  > uncommit =
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
     9
  > drawdag=$TESTDIR/drawdag.py
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    10
  > EOF
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    11
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    12
Build up a repo
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    13
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    14
  $ hg init repo
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    15
  $ cd repo
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    16
  $ hg bookmark foo
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    17
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    18
Help for uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    19
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    20
  $ hg help uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    21
  hg uncommit [OPTION]... [FILE]...
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    22
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    23
  uncommit part or all of a local changeset
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    24
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    25
      This command undoes the effect of a local commit, returning the affected
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    26
      files to their uncommitted state. This means that files modified or
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    27
      deleted in the changeset will be left unchanged, and so will remain
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    28
      modified in the working directory.
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    29
  
36973
d63c5c651183 uncommit: document when the commit will be pruned
Martin von Zweigbergk <martinvonz@google.com>
parents: 36972
diff changeset
    30
      If no files are specified, the commit will be pruned, unless --keep is
d63c5c651183 uncommit: document when the commit will be pruned
Martin von Zweigbergk <martinvonz@google.com>
parents: 36972
diff changeset
    31
      given.
d63c5c651183 uncommit: document when the commit will be pruned
Martin von Zweigbergk <martinvonz@google.com>
parents: 36972
diff changeset
    32
  
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    33
  (use 'hg help -e uncommit' to show help for the uncommit extension)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    34
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    35
  options ([+] can be repeated):
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    36
  
41010
e8e2a7656e83 help: hide default value for default-off flags
Martin von Zweigbergk <martinvonz@google.com>
parents: 41009
diff changeset
    37
      --keep                allow an empty commit after uncommiting
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    38
   -I --include PATTERN [+] include names matching the given patterns
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    39
   -X --exclude PATTERN [+] exclude names matching the given patterns
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    40
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    41
  (some details hidden, use --verbose to show complete help)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    42
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    43
Uncommit with no commits should fail
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    44
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    45
  $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    46
  abort: cannot uncommit null changeset
35244
98f97eb20597 rewriteutil: use precheck() in uncommit and amend commands
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34867
diff changeset
    47
  (no changeset checked out)
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    48
  [255]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    49
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    50
Create some commits
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    51
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    52
  $ touch files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    53
  $ hg add files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    54
  $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg add file-$i; hg commit -m "added file-$i"; done
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    55
  $ ls
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    56
  file-a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    57
  file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    58
  file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    59
  file-abcd
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    60
  file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    61
  files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    62
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    63
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    64
  @  4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    65
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    66
  o  3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    67
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    68
  o  2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    69
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    70
  o  1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    71
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    72
  o  0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    73
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    74
Simple uncommit off the top, also moves bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    75
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    76
  $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    77
   * foo                       4:6c4fd43ed714
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    78
  $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    79
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    80
  M files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    81
  A file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    82
  $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    83
   * foo                       3:6db330d65db4
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    84
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    85
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    86
  x  4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    87
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    88
  @  3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    89
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    90
  o  2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    91
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    92
  o  1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    93
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    94
  o  0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    95
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    96
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    97
Recommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    98
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
    99
  $ hg commit -m 'new change abcde'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   100
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   101
  $ hg heads -T '{rev}:{node} {desc}'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   102
  5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   103
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   104
Uncommit of non-existent and unchanged files has no effect
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   105
  $ hg uncommit nothinghere
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   106
  nothing to uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   107
  [1]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   108
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   109
  $ hg uncommit file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   110
  nothing to uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   111
  [1]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   112
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   113
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   114
Try partial uncommit, also moves bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   115
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   116
  $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   117
   * foo                       5:0c07a3ccda77
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   118
  $ hg uncommit files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   119
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   120
  M files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   121
  $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   122
   * foo                       6:3727deee06f7
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   123
  $ hg heads -T '{rev}:{node} {desc}'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   124
  6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde (no-eol)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   125
  $ hg log -r . -p -T '{rev}:{node} {desc}'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   126
  6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcdediff -r 6db330d65db4 -r 3727deee06f7 file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   127
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   128
  +++ b/file-abcde	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   129
  @@ -0,0 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   130
  +abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   131
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   132
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   133
  @  6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   134
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   135
  | x  5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   136
  |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   137
  | x  4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   138
  |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   139
  o  3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   140
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   141
  o  2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   142
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   143
  o  1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   144
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   145
  o  0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   146
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   147
  $ hg commit -m 'update files for abcde'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   148
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   149
Uncommit with dirty state
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   150
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   151
  $ echo "foo" >> files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   152
  $ cat files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   153
  abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   154
  foo
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   155
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   156
  M files
34284
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34283
diff changeset
   157
  $ hg uncommit
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34283
diff changeset
   158
  abort: uncommitted changes
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34283
diff changeset
   159
  [255]
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   160
  $ hg uncommit files
41745
83d294c71f1e uncommit: inform user if the commit is empty after uncommit
Martin von Zweigbergk <martinvonz@google.com>
parents: 41338
diff changeset
   161
  note: keeping empty commit
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   162
  $ cat files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   163
  abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   164
  foo
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   165
  $ hg commit --amend -m "files abcde + foo"
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   166
34285
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   167
Testing the 'experimental.uncommitondirtywdir' config
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   168
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   169
  $ echo "bar" >> files
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   170
  $ hg uncommit
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   171
  abort: uncommitted changes
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   172
  [255]
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   173
  $ hg uncommit --config experimental.uncommitondirtywdir=True
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   174
  $ hg commit -m "files abcde + foo"
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   175
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   176
Uncommit in the middle of a stack, does not move bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   177
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   178
  $ hg checkout '.^^^'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   179
  1 files updated, 0 files merged, 2 files removed, 0 files unresolved
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   180
  (leaving bookmark foo)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   181
  $ hg log -r . -p -T '{rev}:{node} {desc}'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   182
  2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abcdiff -r 69a232e754b0 -r abf2df566fc1 file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   183
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   184
  +++ b/file-abc	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   185
  @@ -0,0 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   186
  +abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   187
  diff -r 69a232e754b0 -r abf2df566fc1 files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   188
  --- a/files	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   189
  +++ b/files	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   190
  @@ -1,1 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   191
  -ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   192
  +abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   193
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   194
  $ hg bookmark
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   195
     foo                       10:48e5bd7cd583
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   196
  $ hg uncommit
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35508
diff changeset
   197
  3 new orphan changesets
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   198
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   199
  M files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   200
  A file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   201
  $ hg heads -T '{rev}:{node} {desc}'
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   202
  10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol)
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   203
  $ hg bookmark
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   204
     foo                       10:48e5bd7cd583
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   205
  $ hg commit -m 'new abc'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   206
  created new head
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   207
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   208
Partial uncommit in the middle, does not move bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   209
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   210
  $ hg checkout '.^'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   211
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   212
  $ hg log -r . -p -T '{rev}:{node} {desc}'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   213
  1:69a232e754b08d568c4899475faf2eb44b857802 added file-abdiff -r 3004d2d9b508 -r 69a232e754b0 file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   214
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   215
  +++ b/file-ab	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   216
  @@ -0,0 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   217
  +ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   218
  diff -r 3004d2d9b508 -r 69a232e754b0 files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   219
  --- a/files	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   220
  +++ b/files	Thu Jan 01 00:00:00 1970 +0000
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   221
  @@ -1,1 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   222
  -a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   223
  +ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   224
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   225
  $ hg bookmark
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   226
     foo                       10:48e5bd7cd583
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   227
  $ hg uncommit file-ab
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35508
diff changeset
   228
  1 new orphan changesets
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   229
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   230
  A file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   231
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   232
  $ hg heads -T '{rev}:{node} {desc}\n'
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   233
  12:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   234
  11:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   235
  10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   236
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   237
  $ hg bookmark
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   238
     foo                       10:48e5bd7cd583
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   239
  $ hg commit -m 'update ab'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   240
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   241
  $ hg heads -T '{rev}:{node} {desc}\n'
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   242
  13:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   243
  11:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   244
  10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   245
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   246
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   247
  @  13:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   248
  |
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   249
  o  12:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   250
  |
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   251
  | *  11:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   252
  | |
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   253
  | | *  10:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   254
  | | |
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   255
  | | | x  9:8a6b58c173ca6a2e3745d8bd86698718d664bc6c files abcde + foo
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   256
  | | |/
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   257
  | | | x  8:39ad452c7f684a55d161c574340c5766c4569278 update files for abcde
34285
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34284
diff changeset
   258
  | | |/
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   259
  | | | x  7:0977fa602c2fd7d8427ed4e7ee15ea13b84c9173 update files for abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   260
  | | |/
35508
9b3f95d9783d graphlog: add another graph node type, unstable, using character "*" (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 35244
diff changeset
   261
  | | *  6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   262
  | | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   263
  | | | x  5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   264
  | | |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   265
  | | | x  4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   266
  | | |/
35508
9b3f95d9783d graphlog: add another graph node type, unstable, using character "*" (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 35244
diff changeset
   267
  | | *  3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   268
  | | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   269
  | | x  2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   270
  | |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   271
  | x  1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   272
  |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   273
  o  0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   274
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   275
Uncommit with draft parent
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   276
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   277
  $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   278
  $ hg phase -r .
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   279
  12: draft
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   280
  $ hg commit -m 'update ab again'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   281
38422
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   282
Phase is preserved
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   283
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   284
  $ hg uncommit --keep --config phases.new-commit=secret
41745
83d294c71f1e uncommit: inform user if the commit is empty after uncommit
Martin von Zweigbergk <martinvonz@google.com>
parents: 41338
diff changeset
   285
  note: keeping empty commit
38422
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   286
  $ hg phase -r .
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   287
  15: draft
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   288
  $ hg commit --amend -m 'update ab again'
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   289
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   290
Uncommit with public parent
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   291
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   292
  $ hg phase -p "::.^"
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   293
  $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   294
  $ hg phase -r .
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   295
  12: public
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   296
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   297
Partial uncommit with public parent
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   298
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   299
  $ echo xyz > xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   300
  $ hg add xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   301
  $ hg commit -m "update ab and add xyz"
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   302
  $ hg uncommit xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   303
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   304
  A xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   305
  $ hg phase -r .
38422
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36973
diff changeset
   306
  18: draft
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   307
  $ hg phase -r ".^"
36972
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
   308
  12: public
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   309
41750
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   310
Uncommit with --keep or experimental.uncommit.keep leaves an empty changeset
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   311
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   312
  $ cd $TESTTMP
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   313
  $ hg init repo1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   314
  $ cd repo1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   315
  $ hg debugdrawdag <<'EOS'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   316
  > Q
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   317
  > |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   318
  > P
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   319
  > EOS
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   320
  $ hg up Q -q
34283
f94442d46984 uncommit: rename the flag 'empty' to 'keep' which retains empty changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34192
diff changeset
   321
  $ hg uncommit --keep
41745
83d294c71f1e uncommit: inform user if the commit is empty after uncommit
Martin von Zweigbergk <martinvonz@google.com>
parents: 41338
diff changeset
   322
  note: keeping empty commit
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   323
  $ hg log -G -T '{desc} FILES: {files}'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   324
  @  Q FILES:
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   325
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   326
  | x  Q FILES: Q
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   327
  |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   328
  o  P FILES: P
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   329
  
41750
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   330
  $ cat >> .hg/hgrc <<EOF
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   331
  > [experimental]
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   332
  > uncommit.keep=True
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   333
  > EOF
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   334
  $ hg ci --amend
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   335
  $ hg uncommit
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   336
  note: keeping empty commit
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   337
  $ hg log -G -T '{desc} FILES: {files}'
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   338
  @  Q FILES:
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   339
  |
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   340
  | x  Q FILES: Q
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   341
  |/
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   342
  o  P FILES: P
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   343
  
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   344
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   345
  A Q
41750
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   346
  $ hg ci --amend
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   347
  $ hg uncommit --no-keep
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   348
  $ hg log -G -T '{desc} FILES: {files}'
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   349
  x  Q FILES: Q
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   350
  |
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   351
  @  P FILES: P
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   352
  
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   353
  $ hg status
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41745
diff changeset
   354
  A Q
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   355
  $ cd ..
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   356
  $ rm -rf repo1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   357
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   358
Testing uncommit while merge
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   359
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   360
  $ hg init repo2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   361
  $ cd repo2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   362
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   363
Create some history
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   364
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   365
  $ touch a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   366
  $ hg add a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   367
  $ for i in 1 2 3; do echo $i > a; hg commit -m "a $i"; done
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   368
  $ hg checkout 0
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   369
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   370
  $ touch b
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   371
  $ hg add b
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   372
  $ for i in 1 2 3; do echo $i > b; hg commit -m "b $i"; done
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   373
  created new head
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   374
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   375
  @  5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   376
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   377
  o  4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   378
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   379
  o  3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   380
  |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   381
  | o  2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   382
  | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   383
  | o  1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   384
  |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   385
  o  0:ea4e33293d4d274a2ba73150733c2612231f398c a 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   386
  
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   387
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   388
Add and expect uncommit to fail on both merge working dir and merge changeset
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   389
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   390
  $ hg merge 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   391
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   392
  (branch merge, don't forget to commit)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   393
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   394
  $ hg uncommit
34284
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34283
diff changeset
   395
  abort: outstanding uncommitted merge
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   396
  [255]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   397
34304
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34285
diff changeset
   398
  $ hg uncommit --config experimental.uncommitondirtywdir=True
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34285
diff changeset
   399
  abort: cannot uncommit while merging
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34285
diff changeset
   400
  [255]
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34285
diff changeset
   401
34192
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   402
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   403
  M a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   404
  $ hg commit -m 'merge a and b'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   405
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   406
  $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   407
  abort: cannot uncommit merge changeset
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   408
  [255]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   409
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   410
  $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   411
  $ hg log -G -T '{rev}:{node} {desc}' --hidden
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   412
  @    6:c03b9c37bc67bf504d4912061cfb527b47a63c6e merge a and b
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   413
  |\
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   414
  | o  5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   415
  | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   416
  | o  4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   417
  | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   418
  | o  3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   419
  | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   420
  o |  2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   421
  | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   422
  o |  1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   423
  |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   424
  o  0:ea4e33293d4d274a2ba73150733c2612231f398c a 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
   425
  
41338
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   426
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   427
Rename a->b, then remove b in working copy. Result should remove a.
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   428
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   429
  $ hg co -q 0
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   430
  $ hg mv a b
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   431
  $ hg ci -qm 'move a to b'
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   432
  $ hg rm b
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   433
  $ hg uncommit --config experimental.uncommitondirtywdir=True
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   434
  $ hg st --copies
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   435
  R a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   436
  $ hg revert a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   437
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   438
Rename a->b, then rename b->c in working copy. Result should rename a->c.
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   439
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   440
  $ hg co -q 0
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   441
  $ hg mv a b
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   442
  $ hg ci -qm 'move a to b'
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   443
  $ hg mv b c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   444
  $ hg uncommit --config experimental.uncommitondirtywdir=True
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   445
  $ hg st --copies
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   446
  A c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   447
    a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   448
  R a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   449
  $ hg revert a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   450
  $ hg forget c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   451
  $ rm c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   452
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   453
Copy a->b1 and a->b2, then rename b1->c in working copy. Result should copy a->b2 and a->c.
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   454
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   455
  $ hg co -q 0
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   456
  $ hg cp a b1
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   457
  $ hg cp a b2
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   458
  $ hg ci -qm 'move a to b1 and b2'
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   459
  $ hg mv b1 c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   460
  $ hg uncommit --config experimental.uncommitondirtywdir=True
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   461
  $ hg st --copies
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   462
  A b2
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   463
    a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   464
  A c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41010
diff changeset
   465
    a