annotate tests/test-uncommit.t @ 42924:a50661567f83

uncommit: drop the hyphen from --current-user and --current-date I didn't pay enough attention to these long forms- graft, amend and MQ already use the old style naming. It's probably more important to be consistent than modern. The hypenated style came from evolve. Yuya mentioned this naming discrepancy in 4145fd3569c3, but it didn't attract any discussion[1]. There's also a bit of inconsistency in that the default parameter for `currentdate` is `False` for graft, and `None` for the rest. [1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-January/126767.html Differential Revision: https://phab.mercurial-scm.org/D6841
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 10 Sep 2019 22:04:22 -0400
parents 66048f6b5d0d
children 4690902850df
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34204
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: 34311
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
34204
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
36979
d63c5c651183 uncommit: document when the commit will be pruned
Martin von Zweigbergk <martinvonz@google.com>
parents: 36978
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: 36978
diff changeset
31 given.
d63c5c651183 uncommit: document when the commit will be pruned
Martin von Zweigbergk <martinvonz@google.com>
parents: 36978
diff changeset
32
34204
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
41865
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
37 --keep allow an empty commit after uncommiting
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
38 --allow-dirty-working-copy allow uncommit with outstanding changes
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
39 -I --include PATTERN [+] include names matching the given patterns
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
40 -X --exclude PATTERN [+] exclude names matching the given patterns
42908
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
41 -m --message TEXT use text as commit message
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
42 -l --logfile FILE read commit message from file
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
43 -d --date DATE record the specified date as commit date
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
44 -u --user USER record the specified user as committer
42924
a50661567f83 uncommit: drop the hyphen from --current-user and --current-date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42909
diff changeset
45 -D --currentdate record the current date as commit date
a50661567f83 uncommit: drop the hyphen from --current-user and --current-date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42909
diff changeset
46 -U --currentuser record the current user as committer
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
47
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
48 (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
49
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
50 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
51
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
52 $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
53 abort: cannot uncommit null changeset
35253
98f97eb20597 rewriteutil: use precheck() in uncommit and amend commands
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34867
diff changeset
54 (no changeset checked out)
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
55 [255]
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
56
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
57 Create some commits
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
58
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
59 $ touch files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
60 $ hg add files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
61 $ 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
62 $ ls
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
63 file-a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
64 file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
65 file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
66 file-abcd
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
67 file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
68 files
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 $ 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
71 @ 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
72 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
73 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
74 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
75 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
76 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
77 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
78 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
79 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
80
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
81 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
82
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
83 $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
84 * foo 4:6c4fd43ed714
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
85 $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
86 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
87 M files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
88 A file-abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
89 $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
90 * foo 3:6db330d65db4
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 $ 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
93 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
94 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
95 @ 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd
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 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
98 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
99 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
100 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
101 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
102
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 Recommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
105
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
106 $ 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
107 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
108 $ 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
109 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
110
42051
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
111 Uncommit of non-existent and unchanged files aborts
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
112 $ hg uncommit nothinghere
42051
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
113 abort: cannot uncommit "nothinghere"
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
114 (file does not exist)
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
115 [255]
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
116 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
117 $ hg uncommit file-abc
42051
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
118 abort: cannot uncommit "file-abc"
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
119 (file was not changed in working directory parent)
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
120 [255]
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
121 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
122
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
123 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
124
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
125 $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
126 * foo 5:0c07a3ccda77
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
127 $ hg uncommit files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
128 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
129 M files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
130 $ hg bookmark
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
131 * foo 6:3727deee06f7
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
132 $ 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
133 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
134 $ 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
135 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
136 --- /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
137 +++ 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
138 @@ -0,0 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
139 +abcde
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 $ 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
142 @ 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
143 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
144 | 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
145 |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
146 | 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
147 |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
148 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
149 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
150 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
151 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
152 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
153 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
154 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
155
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
156 $ 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
157
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
158 Uncommit with dirty state
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
159
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
160 $ echo "foo" >> files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
161 $ cat files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
162 abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
163 foo
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
164 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
165 M files
34291
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34290
diff changeset
166 $ hg uncommit
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34290
diff changeset
167 abort: uncommitted changes
41865
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
168 (requires --allow-dirty-working-copy to uncommit)
34291
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34290
diff changeset
169 [255]
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
170 $ hg uncommit files
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
171 abort: uncommitted changes
41865
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
172 (requires --allow-dirty-working-copy to uncommit)
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
173 [255]
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
174 $ cat files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
175 abcde
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
176 foo
36978
28ba7d111337 uncommit: leave empty commit if all files are uncommitted
Martin von Zweigbergk <martinvonz@google.com>
parents: 35709
diff changeset
177 $ hg commit --amend -m "files abcde + foo"
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
178
34292
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
179 Testing the 'experimental.uncommitondirtywdir' config
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
180
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
181 $ echo "bar" >> files
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
182 $ hg uncommit
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
183 abort: uncommitted changes
41865
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
184 (requires --allow-dirty-working-copy to uncommit)
34292
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
185 [255]
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
186 $ hg uncommit --config experimental.uncommitondirtywdir=True
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
187 $ hg commit -m "files abcde + foo"
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
188
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
189 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
190
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
191 $ hg checkout '.^^^'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
192 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
193 (leaving bookmark foo)
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
194 $ 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
195 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
196 --- /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
197 +++ 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
198 @@ -0,0 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
199 +abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
200 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
201 --- 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
202 +++ 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
203 @@ -1,1 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
204 -ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
205 +abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
206
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
207 $ hg bookmark
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
208 foo 9:48e5bd7cd583
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
209 $ hg uncommit
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35512
diff changeset
210 3 new orphan changesets
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
211 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
212 M files
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
213 A file-abc
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
214 $ hg heads -T '{rev}:{node} {desc}'
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
215 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo (no-eol)
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
216 $ hg bookmark
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
217 foo 9:48e5bd7cd583
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
218 $ hg commit -m 'new abc'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
219 created new head
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
220
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
221 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
222
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
223 $ hg checkout '.^'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
224 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
225 $ 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
226 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
227 --- /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
228 +++ 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
229 @@ -0,0 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
230 +ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
231 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
232 --- 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
233 +++ 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
234 @@ -1,1 +1,1 @@
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
235 -a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
236 +ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
237
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
238 $ hg bookmark
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
239 foo 9:48e5bd7cd583
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
240 $ hg uncommit file-ab
35709
1a09dad8b85a evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 35512
diff changeset
241 1 new orphan changesets
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
242 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
243 A file-ab
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
244
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
245 $ hg heads -T '{rev}:{node} {desc}\n'
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
246 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
247 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
248 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
249
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
250 $ hg bookmark
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
251 foo 9:48e5bd7cd583
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
252 $ hg commit -m 'update ab'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
253 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
254 $ hg heads -T '{rev}:{node} {desc}\n'
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
255 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
256 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
257 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
258
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
259 $ hg log -G -T '{rev}:{node} {desc}' --hidden
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
260 @ 12:f21039c59242b085491bb58f591afc4ed1c04c09 update ab
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
261 |
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
262 o 11:8eb87968f2edb7f27f27fe676316e179de65fff6 added file-ab
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
263 |
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
264 | * 10:5dc89ca4486f8a88716c5797fa9f498d13d7c2e1 new abc
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
265 | |
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
266 | | * 9:48e5bd7cd583eb24164ef8b89185819c84c96ed7 files abcde + foo
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
267 | | |
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
268 | | | x 8:84beeba0ac30e19521c036e4d2dd3a5fa02586ff files abcde + foo
34292
7b1e524ad73f uncommit: add an experimental.uncommitondirtywdir config
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34291
diff changeset
269 | | |/
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
270 | | | 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
271 | | |/
35512
9b3f95d9783d graphlog: add another graph node type, unstable, using character "*" (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 35253
diff changeset
272 | | * 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
273 | | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
274 | | | 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
275 | | |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
276 | | | 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
277 | | |/
35512
9b3f95d9783d graphlog: add another graph node type, unstable, using character "*" (BC)
Anton Shestakov <av6@dwimlabs.net>
parents: 35253
diff changeset
278 | | * 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
279 | | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
280 | | 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
281 | |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
282 | 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
283 |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
284 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
285
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
286 Uncommit with draft parent
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
287
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
288 $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
289 $ hg phase -r .
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
290 11: draft
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
291 $ 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
292
38428
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36979
diff changeset
293 Phase is preserved
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36979
diff changeset
294
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36979
diff changeset
295 $ hg uncommit --keep --config phases.new-commit=secret
41754
83d294c71f1e uncommit: inform user if the commit is empty after uncommit
Martin von Zweigbergk <martinvonz@google.com>
parents: 41363
diff changeset
296 note: keeping empty commit
38428
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36979
diff changeset
297 $ hg phase -r .
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
298 14: draft
38428
a6addfd64507 tests: add test of uncommit with default phase as secret
Martin von Zweigbergk <martinvonz@google.com>
parents: 36979
diff changeset
299 $ 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: 36979
diff changeset
300
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
301 Uncommit with public parent
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
302
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
303 $ hg phase -p "::.^"
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
304 $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
305 $ hg phase -r .
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
306 11: public
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
307
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
308 Partial uncommit with public parent
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
309
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
310 $ echo xyz > xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
311 $ hg add xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
312 $ 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
313 $ hg uncommit xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
314 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
315 A xyz
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
316 $ hg phase -r .
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
317 17: draft
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
318 $ hg phase -r ".^"
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
319 11: public
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
320
41759
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
321 Uncommit with --keep or experimental.uncommit.keep leaves an empty changeset
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
322
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
323 $ cd $TESTTMP
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
324 $ hg init repo1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
325 $ cd repo1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
326 $ hg debugdrawdag <<'EOS'
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
327 > Q
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
328 > |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
329 > P
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
330 > EOS
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
331 $ hg up Q -q
34290
f94442d46984 uncommit: rename the flag 'empty' to 'keep' which retains empty changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34204
diff changeset
332 $ hg uncommit --keep
41754
83d294c71f1e uncommit: inform user if the commit is empty after uncommit
Martin von Zweigbergk <martinvonz@google.com>
parents: 41363
diff changeset
333 note: keeping empty commit
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
334 $ 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
335 @ Q FILES:
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
336 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
337 | x Q FILES: Q
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
338 |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
339 o P FILES: P
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
340
41759
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
341 $ cat >> .hg/hgrc <<EOF
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
342 > [experimental]
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
343 > uncommit.keep=True
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
344 > EOF
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
345 $ hg ci --amend
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
346 $ hg uncommit
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
347 note: keeping empty commit
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
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: 41754
diff changeset
349 @ Q FILES:
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
350 |
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
351 | x Q FILES: Q
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
352 |/
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
353 o P FILES: P
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
354
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
355 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
356 A Q
41759
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
357 $ hg ci --amend
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
358 $ hg uncommit --no-keep
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
359 $ hg log -G -T '{desc} FILES: {files}'
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
360 x Q FILES: Q
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
361 |
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
362 @ P FILES: P
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
363
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
364 $ hg status
1040d54eb7eb uncommit: add config option to keep commit by default
Martin von Zweigbergk <martinvonz@google.com>
parents: 41754
diff changeset
365 A Q
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
366 $ cd ..
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
367 $ rm -rf repo1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
368
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
369 Testing uncommit while merge
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
370
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
371 $ hg init repo2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
372 $ cd repo2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
373
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
374 Create some history
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
375
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
376 $ touch a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
377 $ hg add a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
378 $ 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
379 $ hg checkout 0
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
380 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
381 $ touch b
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
382 $ hg add b
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
383 $ 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
384 created new head
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
385 $ 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
386 @ 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3
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 o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2
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 o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
391 |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
392 | o 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3
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 | o 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
395 |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
396 o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
397
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
398
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
399 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
400
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
401 $ hg merge 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
402 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
403 (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
404
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
405 $ hg uncommit
34291
624c53e4121d uncommit: don't allow bare uncommit on dirty working directory
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34290
diff changeset
406 abort: outstanding uncommitted merge
41865
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
407 (requires --allow-dirty-working-copy to uncommit)
34204
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
34311
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34292
diff changeset
410 $ hg uncommit --config experimental.uncommitondirtywdir=True
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34292
diff changeset
411 abort: cannot uncommit while merging
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34292
diff changeset
412 [255]
ae510d9691ef uncommit: add a test for uncommit with uncommitondirtywdir config in merge
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34292
diff changeset
413
34204
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
414 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
415 M a
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
416 $ 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
417
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
418 $ hg uncommit
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
419 abort: cannot uncommit merge changeset
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
420 [255]
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 $ hg status
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
423 $ 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
424 @ 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
425 |\
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
426 | o 5:2cd56cdde163ded2fbb16ba2f918c96046ab0bf2 b 3
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
427 | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
428 | o 4:c3a0d5bb3b15834ffd2ef9ef603e93ec65cf2037 b 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
429 | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
430 | o 3:49bb009ca26078726b8870f1edb29fae8f7618f5 b 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
431 | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
432 o | 2:990982b7384266e691f1bc08ca36177adcd1c8a9 a 3
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
433 | |
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
434 o | 1:24d38e3cf160c7b6f5ffe82179332229886a6d34 a 2
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
435 |/
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
436 o 0:ea4e33293d4d274a2ba73150733c2612231f398c a 1
da2f5f19312c uncommit: move fb-extension to core which uncommits a changeset
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff changeset
437
41363
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
438
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
439 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: 41020
diff changeset
440
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
441 $ hg co -q 0
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
442 $ hg mv a b
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
443 $ hg ci -qm 'move a to b'
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
444 $ hg rm b
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
445 $ hg uncommit --config experimental.uncommitondirtywdir=True
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
446 $ hg st --copies
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
447 R a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
448 $ hg revert a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
449
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
450 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: 41020
diff changeset
451
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
452 $ hg co -q 0
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
453 $ hg mv a b
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
454 $ hg ci -qm 'move a to b'
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
455 $ hg mv b c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
456 $ hg uncommit --config experimental.uncommitondirtywdir=True
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
457 $ hg st --copies
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
458 A c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
459 a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
460 R a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
461 $ hg revert a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
462 $ hg forget c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
463 $ rm c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
464
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
465 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: 41020
diff changeset
466
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
467 $ hg co -q 0
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
468 $ hg cp a b1
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
469 $ hg cp a b2
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
470 $ 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: 41020
diff changeset
471 $ hg mv b1 c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
472 $ hg uncommit --config experimental.uncommitondirtywdir=True
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
473 $ hg st --copies
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
474 A b2
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
475 a
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
476 A c
c7d425f7f5c9 tests: add more tests of uncommit/unamend with copies
Martin von Zweigbergk <martinvonz@google.com>
parents: 41020
diff changeset
477 a
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
478 $ cd ..
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
479
41892
8c6ba2909155 tests: fix a stale reference to experimental.uncommitondirtywdir
Martin von Zweigbergk <martinvonz@google.com>
parents: 41865
diff changeset
480 --allow-dirty-working-copy should also work on a dirty PATH
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
481
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
482 $ hg init issue5977
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
483 $ cd issue5977
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
484 $ echo 'super critical info!' > a
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
485 $ hg ci -Am 'add a'
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
486 adding a
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
487 $ echo 'foo' > b
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
488 $ hg add b
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
489 $ hg status
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
490 A b
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
491 $ hg unc a
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
492 note: keeping empty commit
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
493 $ cat a
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
494 super critical info!
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
495 $ hg log
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
496 changeset: 1:656ba143d384
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
497 tag: tip
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
498 parent: -1:000000000000
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
499 user: test
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
500 date: Thu Jan 01 00:00:00 1970 +0000
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
501 summary: add a
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
502
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
503 $ hg ci -Am 'add b'
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
504 $ echo 'foo bar' > b
41893
6a944bf4c43a tests: clarify test setup test in test-uncommit.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 41892
diff changeset
505 $ hg unc b
6a944bf4c43a tests: clarify test setup test in test-uncommit.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 41892
diff changeset
506 abort: uncommitted changes
6a944bf4c43a tests: clarify test setup test in test-uncommit.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 41892
diff changeset
507 (requires --allow-dirty-working-copy to uncommit)
6a944bf4c43a tests: clarify test setup test in test-uncommit.t
Martin von Zweigbergk <martinvonz@google.com>
parents: 41892
diff changeset
508 [255]
41865
aa284d9a33ca uncommit: add flag --allow-dirty-working-copy
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41864
diff changeset
509 $ hg unc --allow-dirty-working-copy b
41864
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
510 $ hg log
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
511 changeset: 3:30fa958635b2
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
512 tag: tip
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
513 parent: 1:656ba143d384
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
514 user: test
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
515 date: Thu Jan 01 00:00:00 1970 +0000
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
516 summary: add b
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
517
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
518 changeset: 1:656ba143d384
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
519 parent: -1:000000000000
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
520 user: test
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
521 date: Thu Jan 01 00:00:00 1970 +0000
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
522 summary: add a
bf22e370ae9a uncommit: don't allow dirty working copy with PATH (issue5977)
Navaneeth Suresh <navaneeths1998@gmail.com>
parents: 41759
diff changeset
523
42051
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
524 Removes can be uncommitted
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
525
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
526 $ hg ci -m 'modified b'
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
527 $ hg rm b
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
528 $ hg ci -m 'remove b'
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
529 $ hg uncommit b
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
530 note: keeping empty commit
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
531 $ hg status
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
532 R b
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
533
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
534 Uncommitting a directory won't run afoul of the checks that an explicit file
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
535 can be uncommitted.
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
536
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
537 $ mkdir dir
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
538 $ echo 1 > dir/file.txt
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
539 $ hg ci -Aqm 'add file in directory'
42908
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
540 $ hg uncommit dir -m 'uncommit with message' -u 'different user' \
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
541 > -d 'Jun 30 12:12:12 1980 +0000'
42051
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
542 $ hg status
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
543 A dir/file.txt
42908
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
544 $ hg log -r .
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
545 changeset: 8:b4dd26dc42e0
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
546 tag: tip
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
547 parent: 6:2278a4c24330
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
548 user: different user
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
549 date: Mon Jun 30 12:12:12 1980 +0000
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
550 summary: uncommit with message
ff1ff2aae132 uncommit: add support to modify the commit message and date
Matt Harbison <matt_harbison@yahoo.com>
parents: 42051
diff changeset
551
42051
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
552
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
553 `uncommit <dir>` and `cd <dir> && uncommit .` behave the same...
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
554
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
555 $ hg rollback -q --config ui.rollback=True
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
556 $ echo 2 > dir/file2.txt
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
557 $ hg ci -Aqm 'add file2 in directory'
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
558 $ hg uncommit dir
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
559 note: keeping empty commit
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
560 $ hg status
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
561 A dir/file2.txt
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
562
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
563 $ hg rollback -q --config ui.rollback=True
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
564 $ cd dir
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
565 $ hg uncommit .
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
566 note: keeping empty commit
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
567 $ hg status
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
568 A dir/file2.txt
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
569 $ cd ..
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
570
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
571 ... and errors out the same way when nothing can be uncommitted
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
572
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
573 $ hg rollback -q --config ui.rollback=True
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
574 $ mkdir emptydir
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
575 $ hg uncommit emptydir
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
576 abort: cannot uncommit "emptydir"
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
577 (file was untracked in working directory parent)
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
578 [255]
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
579
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
580 $ cd emptydir
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
581 $ hg uncommit .
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
582 abort: cannot uncommit "emptydir"
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
583 (file was untracked in working directory parent)
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
584 [255]
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
585 $ hg status
f4147ca63d39 uncommit: abort if an explicitly given file cannot be uncommitted (BC)
Matt Harbison <matt_harbison@yahoo.com>
parents: 41893
diff changeset
586 $ cd ..