Mercurial > public > mercurial-scm > hg
annotate tests/test-githelp.t @ 35718:a10a0d5561a9
githelp: replace suggestion of `hg record`
`hg record` is deprecated in favor of `hg commit --interactive`.
Differential Revision: https://phab.mercurial-scm.org/D1726
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 18 Dec 2017 20:58:00 -0800 |
parents | 8dbd000f7de9 |
children | a4cd8f527a7f |
rev | line source |
---|---|
35714
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 $ cat >> $HGRCPATH << EOF |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 > [extensions] |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 > githelp = |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 > EOF |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
6 $ hg init repo |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
7 $ cd repo |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 $ echo foo > test_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 $ mkdir dir |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
10 $ echo foo > dir/file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
11 $ echo foo > removed_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
12 $ echo foo > deleted_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
13 $ hg add -q . |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
14 $ hg commit -m 'bar' |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
15 $ hg bookmark both |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
16 $ touch both |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
17 $ touch untracked_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
18 $ hg remove removed_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
19 $ rm deleted_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
20 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
21 githelp on a single command should succeed |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 $ hg githelp -- commit |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 hg commit |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
24 $ hg githelp -- git commit |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 hg commit |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 githelp should fail nicely if we don't give it arguments |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
28 $ hg githelp |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
29 abort: missing git command - usage: hg githelp -- <git command> |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
30 [255] |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
31 $ hg githelp -- git |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
32 abort: missing git command - usage: hg githelp -- <git command> |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
33 [255] |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
34 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
35 githelp on a command with options should succeed |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
36 $ hg githelp -- commit -pm "abc" |
35718
a10a0d5561a9
githelp: replace suggestion of `hg record`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35715
diff
changeset
|
37 hg commit --interactive -m 'abc' |
35714
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
38 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
39 githelp on a command with standalone unrecognized option should succeed with warning |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
40 $ hg githelp -- commit -p -v |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
41 ignoring unknown option -v |
35718
a10a0d5561a9
githelp: replace suggestion of `hg record`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35715
diff
changeset
|
42 hg commit --interactive |
35714
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
43 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
44 githelp on a command with unrecognized option packed with other options should fail with error |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
45 $ hg githelp -- commit -pv |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
46 abort: unknown option v packed with other options |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
47 Please try passing the option as it's own flag: -v |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
48 [255] |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
49 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
50 githelp for git rebase --skip |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
51 $ hg githelp -- git rebase --skip |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
52 hg revert --all -r . |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
53 hg rebase --continue |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
54 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
55 githelp for git commit --amend (hg commit --amend pulls up an editor) |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
56 $ hg githelp -- commit --amend |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
57 hg commit --amend |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
58 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
59 githelp for git commit --amend --no-edit (hg amend does not pull up an editor) |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
60 $ hg githelp -- commit --amend --no-edit |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
61 hg amend |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
62 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
63 githelp for git checkout -- . (checking out a directory) |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
64 $ hg githelp -- checkout -- . |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
65 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
66 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
67 hg revert . |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
68 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
69 githelp for git checkout "HEAD^" (should still work to pass a rev) |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
70 $ hg githelp -- checkout "HEAD^" |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
71 hg update .^ |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
72 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
73 githelp checkout: args after -- should be treated as paths no matter what |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
74 $ hg githelp -- checkout -- HEAD |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
75 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
76 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
77 hg revert HEAD |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
78 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
79 githelp for git checkout with rev and path |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
80 $ hg githelp -- checkout "HEAD^" -- file.txt |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
81 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
82 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
83 hg revert -r .^ file.txt |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
84 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
85 githelp for git with rev and path, without separator |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
86 $ hg githelp -- checkout "HEAD^" file.txt |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
87 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
88 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
89 hg revert -r .^ file.txt |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
90 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
91 githelp for checkout with a file as first argument |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
92 $ hg githelp -- checkout test_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
93 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
94 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
95 hg revert test_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
96 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
97 githelp for checkout with a removed file as first argument |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
98 $ hg githelp -- checkout removed_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
99 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
100 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
101 hg revert removed_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
102 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
103 githelp for checkout with a deleted file as first argument |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
104 $ hg githelp -- checkout deleted_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
105 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
106 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
107 hg revert deleted_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
108 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
109 githelp for checkout with a untracked file as first argument |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
110 $ hg githelp -- checkout untracked_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
111 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
112 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
113 hg revert untracked_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
114 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
115 githelp for checkout with a directory as first argument |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
116 $ hg githelp -- checkout dir |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
117 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
118 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
119 hg revert dir |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
120 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
121 githelp for checkout when not in repo root |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
122 $ cd dir |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
123 $ hg githelp -- checkout file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
124 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
125 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
126 hg revert file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
127 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
128 $ cd .. |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
129 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
130 githelp for checkout with an argument that is both a file and a revision |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
131 $ hg githelp -- checkout both |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
132 hg update both |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
133 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
134 githelp for checkout with the -p option |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
135 $ hg githelp -- git checkout -p xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
136 hg revert -i -r xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
137 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
138 $ hg githelp -- git checkout -p xyz -- abc |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
139 note: use --no-backup to avoid creating .orig files |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
140 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
141 hg revert -i -r xyz abc |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
142 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
143 githelp for checkout with the -f option and a rev |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
144 $ hg githelp -- git checkout -f xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
145 hg update -C xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
146 $ hg githelp -- git checkout --force xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
147 hg update -C xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
148 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
149 githelp for checkout with the -f option without an arg |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
150 $ hg githelp -- git checkout -f |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
151 hg revert --all |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
152 $ hg githelp -- git checkout --force |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
153 hg revert --all |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
154 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
155 githelp for grep with pattern and path |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
156 $ hg githelp -- grep shrubbery flib/intern/ |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
157 hg grep shrubbery flib/intern/ |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
158 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
159 githelp for reset, checking ~ in git becomes ~1 in mercurial |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
160 $ hg githelp -- reset HEAD~ |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
161 hg reset .~1 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
162 $ hg githelp -- reset "HEAD^" |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
163 hg reset .^ |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
164 $ hg githelp -- reset HEAD~3 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
165 hg reset .~3 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
166 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
167 githelp for git show --name-status |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
168 $ hg githelp -- git show --name-status |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
169 hg log --style status -r tip |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
170 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
171 githelp for git show --pretty=format: --name-status |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
172 $ hg githelp -- git show --pretty=format: --name-status |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
173 hg stat --change tip |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
174 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
175 githelp for show with no arguments |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
176 $ hg githelp -- show |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
177 hg show |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
178 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
179 githelp for show with a path |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
180 $ hg githelp -- show test_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
181 hg show . test_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
182 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
183 githelp for show with not a path: |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
184 $ hg githelp -- show rev |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
185 hg show rev |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
186 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
187 githelp for show with many arguments |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
188 $ hg githelp -- show argone argtwo |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
189 hg show argone argtwo |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
190 $ hg githelp -- show test_file argone argtwo |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
191 hg show . test_file argone argtwo |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
192 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
193 githelp for show with --unified options |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
194 $ hg githelp -- show --unified=10 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
195 hg show --config diff.unified=10 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
196 $ hg githelp -- show -U100 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
197 hg show --config diff.unified=100 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
198 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
199 githelp for show with a path and --unified |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
200 $ hg githelp -- show -U20 test_file |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
201 hg show . test_file --config diff.unified=20 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
202 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
203 githelp for stash drop without name |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
204 $ hg githelp -- git stash drop |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
205 hg shelve -d <shelve name> |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
206 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
207 githelp for stash drop with name |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
208 $ hg githelp -- git stash drop xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
209 hg shelve -d xyz |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
210 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
211 githelp for whatchanged should show deprecated message |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
212 $ hg githelp -- whatchanged -p |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
213 This command has been deprecated in the git project, thus isn't supported by this tool. |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
214 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
215 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
216 githelp for git branch -m renaming |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
217 $ hg githelp -- git branch -m old new |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
218 hg bookmark -m old new |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
219 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
220 When the old name is omitted, git branch -m new renames the current branch. |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
221 $ hg githelp -- git branch -m new |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
222 hg bookmark -m `hg log -T"{activebookmark}" -r .` new |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
223 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
224 Branch deletion in git strips commits |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
225 $ hg githelp -- git branch -d |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
226 hg strip -B |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
227 $ hg githelp -- git branch -d feature |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
228 hg strip -B feature -B |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
229 $ hg githelp -- git branch --delete experiment1 experiment2 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
230 hg strip -B experiment1 -B experiment2 -B |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
231 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
232 githelp for reuse message using the shorthand |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
233 $ hg githelp -- git commit -C deadbeef |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
234 hg commit -M deadbeef |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
235 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
236 githelp for reuse message using the the long version |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
237 $ hg githelp -- git commit --reuse-message deadbeef |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
238 hg commit -M deadbeef |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
239 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
240 githelp for apply with no options |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
241 $ hg githelp -- apply |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
242 hg import --no-commit |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
243 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
244 githelp for apply with directory strip custom |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
245 $ hg githelp -- apply -p 5 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
246 hg import --no-commit -p 5 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
247 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
248 git merge-base |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
249 $ hg githelp -- git merge-base --is-ancestor |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
250 ignoring unknown option --is-ancestor |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
251 NOTE: ancestors() is part of the revset language. |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
252 Learn more about revsets with 'hg help revsets' |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
253 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
254 hg log -T '{node}\n' -r 'ancestor(A,B)' |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
255 |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
256 githelp for git blame |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
257 $ hg githelp -- git blame |
113281667205
githelp: vendor Facebook authored extension
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
258 hg annotate -udl |
35715
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
259 |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
260 githelp for add |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
261 |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
262 $ hg githelp -- git add |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
263 hg add |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
264 |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
265 $ hg githelp -- git add -p |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
266 note: Mercurial will commit when complete, as there is no staging area in Mercurial |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
267 |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
268 hg commit --interactive |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
269 |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
270 $ hg githelp -- git add --all |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
271 note: use hg addremove to remove files that have been deleted. |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
272 |
8dbd000f7de9
githelp: improve help for `git add`
Gregory Szorc <gregory.szorc@gmail.com>
parents:
35714
diff
changeset
|
273 hg add |