##// END OF EJS Templates
record: omit meaningless 'qnew' suggestion at 'hg qnew -i'...
FUJIWARA Katsunori -
r25797:cc9fb459 default
parent child Browse files
Show More
@@ -1,141 +1,143 b''
1 # record.py
1 # record.py
2 #
2 #
3 # Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
3 # Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 '''commands to interactively select changes for commit/qrefresh'''
8 '''commands to interactively select changes for commit/qrefresh'''
9
9
10 from mercurial.i18n import _
10 from mercurial.i18n import _
11 from mercurial import cmdutil, commands, extensions
11 from mercurial import cmdutil, commands, extensions
12 from mercurial import util
12 from mercurial import util
13
13
14 cmdtable = {}
14 cmdtable = {}
15 command = cmdutil.command(cmdtable)
15 command = cmdutil.command(cmdtable)
16 # Note for extension authors: ONLY specify testedwith = 'internal' for
16 # Note for extension authors: ONLY specify testedwith = 'internal' for
17 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
17 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
18 # be specifying the version(s) of Mercurial they are tested with, or
18 # be specifying the version(s) of Mercurial they are tested with, or
19 # leave the attribute unspecified.
19 # leave the attribute unspecified.
20 testedwith = 'internal'
20 testedwith = 'internal'
21
21
22
22
23 @command("record",
23 @command("record",
24 # same options as commit + white space diff options
24 # same options as commit + white space diff options
25 [c for c in commands.table['^commit|ci'][1][:]
25 [c for c in commands.table['^commit|ci'][1][:]
26 if c[1] != "interactive"] + commands.diffwsopts,
26 if c[1] != "interactive"] + commands.diffwsopts,
27 _('hg record [OPTION]... [FILE]...'))
27 _('hg record [OPTION]... [FILE]...'))
28 def record(ui, repo, *pats, **opts):
28 def record(ui, repo, *pats, **opts):
29 '''interactively select changes to commit
29 '''interactively select changes to commit
30
30
31 If a list of files is omitted, all changes reported by :hg:`status`
31 If a list of files is omitted, all changes reported by :hg:`status`
32 will be candidates for recording.
32 will be candidates for recording.
33
33
34 See :hg:`help dates` for a list of formats valid for -d/--date.
34 See :hg:`help dates` for a list of formats valid for -d/--date.
35
35
36 You will be prompted for whether to record changes to each
36 You will be prompted for whether to record changes to each
37 modified file, and for files with multiple changes, for each
37 modified file, and for files with multiple changes, for each
38 change to use. For each query, the following responses are
38 change to use. For each query, the following responses are
39 possible::
39 possible::
40
40
41 y - record this change
41 y - record this change
42 n - skip this change
42 n - skip this change
43 e - edit this change manually
43 e - edit this change manually
44
44
45 s - skip remaining changes to this file
45 s - skip remaining changes to this file
46 f - record remaining changes to this file
46 f - record remaining changes to this file
47
47
48 d - done, skip remaining changes and files
48 d - done, skip remaining changes and files
49 a - record all changes to all remaining files
49 a - record all changes to all remaining files
50 q - quit, recording no changes
50 q - quit, recording no changes
51
51
52 ? - display help
52 ? - display help
53
53
54 This command is not available when committing a merge.'''
54 This command is not available when committing a merge.'''
55
55
56 if not ui.interactive():
56 if not ui.interactive():
57 raise util.Abort(_('running non-interactively, use %s instead') %
57 raise util.Abort(_('running non-interactively, use %s instead') %
58 'commit')
58 'commit')
59
59
60 opts["interactive"] = True
60 opts["interactive"] = True
61 backup = ui.backupconfig('experimental', 'crecord')
61 backup = ui.backupconfig('experimental', 'crecord')
62 try:
62 try:
63 ui.setconfig('experimental', 'crecord', False, 'record')
63 ui.setconfig('experimental', 'crecord', False, 'record')
64 commands.commit(ui, repo, *pats, **opts)
64 commands.commit(ui, repo, *pats, **opts)
65 finally:
65 finally:
66 ui.restoreconfig(backup)
66 ui.restoreconfig(backup)
67
67
68 def qrefresh(origfn, ui, repo, *pats, **opts):
68 def qrefresh(origfn, ui, repo, *pats, **opts):
69 if not opts['interactive']:
69 if not opts['interactive']:
70 return origfn(ui, repo, *pats, **opts)
70 return origfn(ui, repo, *pats, **opts)
71
71
72 mq = extensions.find('mq')
72 mq = extensions.find('mq')
73
73
74 def committomq(ui, repo, *pats, **opts):
74 def committomq(ui, repo, *pats, **opts):
75 # At this point the working copy contains only changes that
75 # At this point the working copy contains only changes that
76 # were accepted. All other changes were reverted.
76 # were accepted. All other changes were reverted.
77 # We can't pass *pats here since qrefresh will undo all other
77 # We can't pass *pats here since qrefresh will undo all other
78 # changed files in the patch that aren't in pats.
78 # changed files in the patch that aren't in pats.
79 mq.refresh(ui, repo, **opts)
79 mq.refresh(ui, repo, **opts)
80
80
81 # backup all changed files
81 # backup all changed files
82 cmdutil.dorecord(ui, repo, committomq, 'qrefresh', True,
82 cmdutil.dorecord(ui, repo, committomq, 'qrefresh', True,
83 cmdutil.recordfilter, *pats, **opts)
83 cmdutil.recordfilter, *pats, **opts)
84
84
85 # This command registration is replaced during uisetup().
85 # This command registration is replaced during uisetup().
86 @command('qrecord',
86 @command('qrecord',
87 [],
87 [],
88 _('hg qrecord [OPTION]... PATCH [FILE]...'),
88 _('hg qrecord [OPTION]... PATCH [FILE]...'),
89 inferrepo=True)
89 inferrepo=True)
90 def qrecord(ui, repo, patch, *pats, **opts):
90 def qrecord(ui, repo, patch, *pats, **opts):
91 '''interactively record a new patch
91 '''interactively record a new patch
92
92
93 See :hg:`help qnew` & :hg:`help record` for more information and
93 See :hg:`help qnew` & :hg:`help record` for more information and
94 usage.
94 usage.
95 '''
95 '''
96 return _qrecord('qnew', ui, repo, patch, *pats, **opts)
96
97
98 def _qrecord(cmdsuggest, ui, repo, patch, *pats, **opts):
97 try:
99 try:
98 mq = extensions.find('mq')
100 mq = extensions.find('mq')
99 except KeyError:
101 except KeyError:
100 raise util.Abort(_("'mq' extension not loaded"))
102 raise util.Abort(_("'mq' extension not loaded"))
101
103
102 repo.mq.checkpatchname(patch)
104 repo.mq.checkpatchname(patch)
103
105
104 def committomq(ui, repo, *pats, **opts):
106 def committomq(ui, repo, *pats, **opts):
105 opts['checkname'] = False
107 opts['checkname'] = False
106 mq.new(ui, repo, patch, *pats, **opts)
108 mq.new(ui, repo, patch, *pats, **opts)
107
109
108 backup = ui.backupconfig('experimental', 'crecord')
110 backup = ui.backupconfig('experimental', 'crecord')
109 try:
111 try:
110 ui.setconfig('experimental', 'crecord', False, 'record')
112 ui.setconfig('experimental', 'crecord', False, 'record')
111 cmdutil.dorecord(ui, repo, committomq, 'qnew', False,
113 cmdutil.dorecord(ui, repo, committomq, cmdsuggest, False,
112 cmdutil.recordfilter, *pats, **opts)
114 cmdutil.recordfilter, *pats, **opts)
113 finally:
115 finally:
114 ui.restoreconfig(backup)
116 ui.restoreconfig(backup)
115
117
116 def qnew(origfn, ui, repo, patch, *args, **opts):
118 def qnew(origfn, ui, repo, patch, *args, **opts):
117 if opts['interactive']:
119 if opts['interactive']:
118 return qrecord(ui, repo, patch, *args, **opts)
120 return _qrecord(None, ui, repo, patch, *args, **opts)
119 return origfn(ui, repo, patch, *args, **opts)
121 return origfn(ui, repo, patch, *args, **opts)
120
122
121
123
122 def uisetup(ui):
124 def uisetup(ui):
123 try:
125 try:
124 mq = extensions.find('mq')
126 mq = extensions.find('mq')
125 except KeyError:
127 except KeyError:
126 return
128 return
127
129
128 cmdtable["qrecord"] = \
130 cmdtable["qrecord"] = \
129 (qrecord,
131 (qrecord,
130 # same options as qnew, but copy them so we don't get
132 # same options as qnew, but copy them so we don't get
131 # -i/--interactive for qrecord and add white space diff options
133 # -i/--interactive for qrecord and add white space diff options
132 mq.cmdtable['^qnew'][1][:] + commands.diffwsopts,
134 mq.cmdtable['^qnew'][1][:] + commands.diffwsopts,
133 _('hg qrecord [OPTION]... PATCH [FILE]...'))
135 _('hg qrecord [OPTION]... PATCH [FILE]...'))
134
136
135 _wrapcmd('qnew', mq.cmdtable, qnew, _("interactively record a new patch"))
137 _wrapcmd('qnew', mq.cmdtable, qnew, _("interactively record a new patch"))
136 _wrapcmd('qrefresh', mq.cmdtable, qrefresh,
138 _wrapcmd('qrefresh', mq.cmdtable, qrefresh,
137 _("interactively select changes to refresh"))
139 _("interactively select changes to refresh"))
138
140
139 def _wrapcmd(cmd, table, wrapfn, msg):
141 def _wrapcmd(cmd, table, wrapfn, msg):
140 entry = extensions.wrapcommand(table, cmd, wrapfn)
142 entry = extensions.wrapcommand(table, cmd, wrapfn)
141 entry[1].append(('i', 'interactive', None, msg))
143 entry[1].append(('i', 'interactive', None, msg))
@@ -1,356 +1,362 b''
1 Create configuration
1 Create configuration
2
2
3 $ echo "[ui]" >> $HGRCPATH
3 $ echo "[ui]" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
4 $ echo "interactive=true" >> $HGRCPATH
5
5
6 help qrefresh (no record)
6 help qrefresh (no record)
7
7
8 $ echo "[extensions]" >> $HGRCPATH
8 $ echo "[extensions]" >> $HGRCPATH
9 $ echo "mq=" >> $HGRCPATH
9 $ echo "mq=" >> $HGRCPATH
10 $ hg help qrefresh
10 $ hg help qrefresh
11 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
11 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
12
12
13 update the current patch
13 update the current patch
14
14
15 If any file patterns are provided, the refreshed patch will contain only
15 If any file patterns are provided, the refreshed patch will contain only
16 the modifications that match those patterns; the remaining modifications
16 the modifications that match those patterns; the remaining modifications
17 will remain in the working directory.
17 will remain in the working directory.
18
18
19 If -s/--short is specified, files currently included in the patch will be
19 If -s/--short is specified, files currently included in the patch will be
20 refreshed just like matched files and remain in the patch.
20 refreshed just like matched files and remain in the patch.
21
21
22 If -e/--edit is specified, Mercurial will start your configured editor for
22 If -e/--edit is specified, Mercurial will start your configured editor for
23 you to enter a message. In case qrefresh fails, you will find a backup of
23 you to enter a message. In case qrefresh fails, you will find a backup of
24 your message in ".hg/last-message.txt".
24 your message in ".hg/last-message.txt".
25
25
26 hg add/remove/copy/rename work as usual, though you might want to use git-
26 hg add/remove/copy/rename work as usual, though you might want to use git-
27 style patches (-g/--git or [diff] git=1) to track copies and renames. See
27 style patches (-g/--git or [diff] git=1) to track copies and renames. See
28 the diffs help topic for more information on the git diff format.
28 the diffs help topic for more information on the git diff format.
29
29
30 Returns 0 on success.
30 Returns 0 on success.
31
31
32 options ([+] can be repeated):
32 options ([+] can be repeated):
33
33
34 -e --edit invoke editor on commit messages
34 -e --edit invoke editor on commit messages
35 -g --git use git extended diff format
35 -g --git use git extended diff format
36 -s --short refresh only files already in the patch and
36 -s --short refresh only files already in the patch and
37 specified files
37 specified files
38 -U --currentuser add/update author field in patch with current user
38 -U --currentuser add/update author field in patch with current user
39 -u --user USER add/update author field in patch with given user
39 -u --user USER add/update author field in patch with given user
40 -D --currentdate add/update date field in patch with current date
40 -D --currentdate add/update date field in patch with current date
41 -d --date DATE add/update date field in patch with given date
41 -d --date DATE add/update date field in patch with given date
42 -I --include PATTERN [+] include names matching the given patterns
42 -I --include PATTERN [+] include names matching the given patterns
43 -X --exclude PATTERN [+] exclude names matching the given patterns
43 -X --exclude PATTERN [+] exclude names matching the given patterns
44 -m --message TEXT use text as commit message
44 -m --message TEXT use text as commit message
45 -l --logfile FILE read commit message from file
45 -l --logfile FILE read commit message from file
46
46
47 (some details hidden, use --verbose to show complete help)
47 (some details hidden, use --verbose to show complete help)
48
48
49 help qrefresh (record)
49 help qrefresh (record)
50
50
51 $ echo "record=" >> $HGRCPATH
51 $ echo "record=" >> $HGRCPATH
52 $ hg help qrefresh
52 $ hg help qrefresh
53 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
53 hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...
54
54
55 update the current patch
55 update the current patch
56
56
57 If any file patterns are provided, the refreshed patch will contain only
57 If any file patterns are provided, the refreshed patch will contain only
58 the modifications that match those patterns; the remaining modifications
58 the modifications that match those patterns; the remaining modifications
59 will remain in the working directory.
59 will remain in the working directory.
60
60
61 If -s/--short is specified, files currently included in the patch will be
61 If -s/--short is specified, files currently included in the patch will be
62 refreshed just like matched files and remain in the patch.
62 refreshed just like matched files and remain in the patch.
63
63
64 If -e/--edit is specified, Mercurial will start your configured editor for
64 If -e/--edit is specified, Mercurial will start your configured editor for
65 you to enter a message. In case qrefresh fails, you will find a backup of
65 you to enter a message. In case qrefresh fails, you will find a backup of
66 your message in ".hg/last-message.txt".
66 your message in ".hg/last-message.txt".
67
67
68 hg add/remove/copy/rename work as usual, though you might want to use git-
68 hg add/remove/copy/rename work as usual, though you might want to use git-
69 style patches (-g/--git or [diff] git=1) to track copies and renames. See
69 style patches (-g/--git or [diff] git=1) to track copies and renames. See
70 the diffs help topic for more information on the git diff format.
70 the diffs help topic for more information on the git diff format.
71
71
72 Returns 0 on success.
72 Returns 0 on success.
73
73
74 options ([+] can be repeated):
74 options ([+] can be repeated):
75
75
76 -e --edit invoke editor on commit messages
76 -e --edit invoke editor on commit messages
77 -g --git use git extended diff format
77 -g --git use git extended diff format
78 -s --short refresh only files already in the patch and
78 -s --short refresh only files already in the patch and
79 specified files
79 specified files
80 -U --currentuser add/update author field in patch with current user
80 -U --currentuser add/update author field in patch with current user
81 -u --user USER add/update author field in patch with given user
81 -u --user USER add/update author field in patch with given user
82 -D --currentdate add/update date field in patch with current date
82 -D --currentdate add/update date field in patch with current date
83 -d --date DATE add/update date field in patch with given date
83 -d --date DATE add/update date field in patch with given date
84 -I --include PATTERN [+] include names matching the given patterns
84 -I --include PATTERN [+] include names matching the given patterns
85 -X --exclude PATTERN [+] exclude names matching the given patterns
85 -X --exclude PATTERN [+] exclude names matching the given patterns
86 -m --message TEXT use text as commit message
86 -m --message TEXT use text as commit message
87 -l --logfile FILE read commit message from file
87 -l --logfile FILE read commit message from file
88 -i --interactive interactively select changes to refresh
88 -i --interactive interactively select changes to refresh
89
89
90 (some details hidden, use --verbose to show complete help)
90 (some details hidden, use --verbose to show complete help)
91
91
92 $ hg init a
92 $ hg init a
93 $ cd a
93 $ cd a
94
94
95 Base commit
95 Base commit
96
96
97 $ cat > 1.txt <<EOF
97 $ cat > 1.txt <<EOF
98 > 1
98 > 1
99 > 2
99 > 2
100 > 3
100 > 3
101 > 4
101 > 4
102 > 5
102 > 5
103 > EOF
103 > EOF
104 $ cat > 2.txt <<EOF
104 $ cat > 2.txt <<EOF
105 > a
105 > a
106 > b
106 > b
107 > c
107 > c
108 > d
108 > d
109 > e
109 > e
110 > f
110 > f
111 > EOF
111 > EOF
112
112
113 $ mkdir dir
113 $ mkdir dir
114 $ cat > dir/a.txt <<EOF
114 $ cat > dir/a.txt <<EOF
115 > hello world
115 > hello world
116 >
116 >
117 > someone
117 > someone
118 > up
118 > up
119 > there
119 > there
120 > loves
120 > loves
121 > me
121 > me
122 > EOF
122 > EOF
123
123
124 $ hg add 1.txt 2.txt dir/a.txt
124 $ hg add 1.txt 2.txt dir/a.txt
125 $ hg commit -m aaa
125 $ hg commit -m aaa
126 $ hg qrecord --config ui.interactive=false patch
127 abort: running non-interactively, use qnew instead
128 [255]
129 $ hg qnew -i --config ui.interactive=false patch
130 abort: running non-interactively
131 [255]
126 $ hg qnew -d '0 0' patch
132 $ hg qnew -d '0 0' patch
127
133
128 Changing files
134 Changing files
129
135
130 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
136 $ sed -e 's/2/2 2/;s/4/4 4/' 1.txt > 1.txt.new
131 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
137 $ sed -e 's/b/b b/' 2.txt > 2.txt.new
132 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
138 $ sed -e 's/hello world/hello world!/' dir/a.txt > dir/a.txt.new
133
139
134 $ mv -f 1.txt.new 1.txt
140 $ mv -f 1.txt.new 1.txt
135 $ mv -f 2.txt.new 2.txt
141 $ mv -f 2.txt.new 2.txt
136 $ mv -f dir/a.txt.new dir/a.txt
142 $ mv -f dir/a.txt.new dir/a.txt
137
143
138 Whole diff
144 Whole diff
139
145
140 $ hg diff --nodates
146 $ hg diff --nodates
141 diff -r ed27675cb5df 1.txt
147 diff -r ed27675cb5df 1.txt
142 --- a/1.txt
148 --- a/1.txt
143 +++ b/1.txt
149 +++ b/1.txt
144 @@ -1,5 +1,5 @@
150 @@ -1,5 +1,5 @@
145 1
151 1
146 -2
152 -2
147 +2 2
153 +2 2
148 3
154 3
149 -4
155 -4
150 +4 4
156 +4 4
151 5
157 5
152 diff -r ed27675cb5df 2.txt
158 diff -r ed27675cb5df 2.txt
153 --- a/2.txt
159 --- a/2.txt
154 +++ b/2.txt
160 +++ b/2.txt
155 @@ -1,5 +1,5 @@
161 @@ -1,5 +1,5 @@
156 a
162 a
157 -b
163 -b
158 +b b
164 +b b
159 c
165 c
160 d
166 d
161 e
167 e
162 diff -r ed27675cb5df dir/a.txt
168 diff -r ed27675cb5df dir/a.txt
163 --- a/dir/a.txt
169 --- a/dir/a.txt
164 +++ b/dir/a.txt
170 +++ b/dir/a.txt
165 @@ -1,4 +1,4 @@
171 @@ -1,4 +1,4 @@
166 -hello world
172 -hello world
167 +hello world!
173 +hello world!
168
174
169 someone
175 someone
170 up
176 up
171
177
172 partial qrefresh
178 partial qrefresh
173
179
174 $ hg qrefresh -i -d '0 0' <<EOF
180 $ hg qrefresh -i -d '0 0' <<EOF
175 > y
181 > y
176 > y
182 > y
177 > n
183 > n
178 > y
184 > y
179 > y
185 > y
180 > n
186 > n
181 > EOF
187 > EOF
182 diff --git a/1.txt b/1.txt
188 diff --git a/1.txt b/1.txt
183 2 hunks, 2 lines changed
189 2 hunks, 2 lines changed
184 examine changes to '1.txt'? [Ynesfdaq?] y
190 examine changes to '1.txt'? [Ynesfdaq?] y
185
191
186 @@ -1,3 +1,3 @@
192 @@ -1,3 +1,3 @@
187 1
193 1
188 -2
194 -2
189 +2 2
195 +2 2
190 3
196 3
191 record change 1/4 to '1.txt'? [Ynesfdaq?] y
197 record change 1/4 to '1.txt'? [Ynesfdaq?] y
192
198
193 @@ -3,3 +3,3 @@
199 @@ -3,3 +3,3 @@
194 3
200 3
195 -4
201 -4
196 +4 4
202 +4 4
197 5
203 5
198 record change 2/4 to '1.txt'? [Ynesfdaq?] n
204 record change 2/4 to '1.txt'? [Ynesfdaq?] n
199
205
200 diff --git a/2.txt b/2.txt
206 diff --git a/2.txt b/2.txt
201 1 hunks, 1 lines changed
207 1 hunks, 1 lines changed
202 examine changes to '2.txt'? [Ynesfdaq?] y
208 examine changes to '2.txt'? [Ynesfdaq?] y
203
209
204 @@ -1,5 +1,5 @@
210 @@ -1,5 +1,5 @@
205 a
211 a
206 -b
212 -b
207 +b b
213 +b b
208 c
214 c
209 d
215 d
210 e
216 e
211 record change 3/4 to '2.txt'? [Ynesfdaq?] y
217 record change 3/4 to '2.txt'? [Ynesfdaq?] y
212
218
213 diff --git a/dir/a.txt b/dir/a.txt
219 diff --git a/dir/a.txt b/dir/a.txt
214 1 hunks, 1 lines changed
220 1 hunks, 1 lines changed
215 examine changes to 'dir/a.txt'? [Ynesfdaq?] n
221 examine changes to 'dir/a.txt'? [Ynesfdaq?] n
216
222
217
223
218 After partial qrefresh 'tip'
224 After partial qrefresh 'tip'
219
225
220 $ hg tip -p
226 $ hg tip -p
221 changeset: 1:0738af1a8211
227 changeset: 1:0738af1a8211
222 tag: patch
228 tag: patch
223 tag: qbase
229 tag: qbase
224 tag: qtip
230 tag: qtip
225 tag: tip
231 tag: tip
226 user: test
232 user: test
227 date: Thu Jan 01 00:00:00 1970 +0000
233 date: Thu Jan 01 00:00:00 1970 +0000
228 summary: [mq]: patch
234 summary: [mq]: patch
229
235
230 diff -r 1fd39ab63a33 -r 0738af1a8211 1.txt
236 diff -r 1fd39ab63a33 -r 0738af1a8211 1.txt
231 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
237 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
232 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
238 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
233 @@ -1,5 +1,5 @@
239 @@ -1,5 +1,5 @@
234 1
240 1
235 -2
241 -2
236 +2 2
242 +2 2
237 3
243 3
238 4
244 4
239 5
245 5
240 diff -r 1fd39ab63a33 -r 0738af1a8211 2.txt
246 diff -r 1fd39ab63a33 -r 0738af1a8211 2.txt
241 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
247 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
242 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
248 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
243 @@ -1,5 +1,5 @@
249 @@ -1,5 +1,5 @@
244 a
250 a
245 -b
251 -b
246 +b b
252 +b b
247 c
253 c
248 d
254 d
249 e
255 e
250
256
251 After partial qrefresh 'diff'
257 After partial qrefresh 'diff'
252
258
253 $ hg diff --nodates
259 $ hg diff --nodates
254 diff -r 0738af1a8211 1.txt
260 diff -r 0738af1a8211 1.txt
255 --- a/1.txt
261 --- a/1.txt
256 +++ b/1.txt
262 +++ b/1.txt
257 @@ -1,5 +1,5 @@
263 @@ -1,5 +1,5 @@
258 1
264 1
259 2 2
265 2 2
260 3
266 3
261 -4
267 -4
262 +4 4
268 +4 4
263 5
269 5
264 diff -r 0738af1a8211 dir/a.txt
270 diff -r 0738af1a8211 dir/a.txt
265 --- a/dir/a.txt
271 --- a/dir/a.txt
266 +++ b/dir/a.txt
272 +++ b/dir/a.txt
267 @@ -1,4 +1,4 @@
273 @@ -1,4 +1,4 @@
268 -hello world
274 -hello world
269 +hello world!
275 +hello world!
270
276
271 someone
277 someone
272 up
278 up
273
279
274 qrefresh interactively everything else
280 qrefresh interactively everything else
275
281
276 $ hg qrefresh -i -d '0 0' <<EOF
282 $ hg qrefresh -i -d '0 0' <<EOF
277 > y
283 > y
278 > y
284 > y
279 > y
285 > y
280 > y
286 > y
281 > EOF
287 > EOF
282 diff --git a/1.txt b/1.txt
288 diff --git a/1.txt b/1.txt
283 1 hunks, 1 lines changed
289 1 hunks, 1 lines changed
284 examine changes to '1.txt'? [Ynesfdaq?] y
290 examine changes to '1.txt'? [Ynesfdaq?] y
285
291
286 @@ -1,5 +1,5 @@
292 @@ -1,5 +1,5 @@
287 1
293 1
288 2 2
294 2 2
289 3
295 3
290 -4
296 -4
291 +4 4
297 +4 4
292 5
298 5
293 record change 1/2 to '1.txt'? [Ynesfdaq?] y
299 record change 1/2 to '1.txt'? [Ynesfdaq?] y
294
300
295 diff --git a/dir/a.txt b/dir/a.txt
301 diff --git a/dir/a.txt b/dir/a.txt
296 1 hunks, 1 lines changed
302 1 hunks, 1 lines changed
297 examine changes to 'dir/a.txt'? [Ynesfdaq?] y
303 examine changes to 'dir/a.txt'? [Ynesfdaq?] y
298
304
299 @@ -1,4 +1,4 @@
305 @@ -1,4 +1,4 @@
300 -hello world
306 -hello world
301 +hello world!
307 +hello world!
302
308
303 someone
309 someone
304 up
310 up
305 record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y
311 record change 2/2 to 'dir/a.txt'? [Ynesfdaq?] y
306
312
307
313
308 After final qrefresh 'tip'
314 After final qrefresh 'tip'
309
315
310 $ hg tip -p
316 $ hg tip -p
311 changeset: 1:2c3f66afeed9
317 changeset: 1:2c3f66afeed9
312 tag: patch
318 tag: patch
313 tag: qbase
319 tag: qbase
314 tag: qtip
320 tag: qtip
315 tag: tip
321 tag: tip
316 user: test
322 user: test
317 date: Thu Jan 01 00:00:00 1970 +0000
323 date: Thu Jan 01 00:00:00 1970 +0000
318 summary: [mq]: patch
324 summary: [mq]: patch
319
325
320 diff -r 1fd39ab63a33 -r 2c3f66afeed9 1.txt
326 diff -r 1fd39ab63a33 -r 2c3f66afeed9 1.txt
321 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
327 --- a/1.txt Thu Jan 01 00:00:00 1970 +0000
322 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
328 +++ b/1.txt Thu Jan 01 00:00:00 1970 +0000
323 @@ -1,5 +1,5 @@
329 @@ -1,5 +1,5 @@
324 1
330 1
325 -2
331 -2
326 +2 2
332 +2 2
327 3
333 3
328 -4
334 -4
329 +4 4
335 +4 4
330 5
336 5
331 diff -r 1fd39ab63a33 -r 2c3f66afeed9 2.txt
337 diff -r 1fd39ab63a33 -r 2c3f66afeed9 2.txt
332 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
338 --- a/2.txt Thu Jan 01 00:00:00 1970 +0000
333 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
339 +++ b/2.txt Thu Jan 01 00:00:00 1970 +0000
334 @@ -1,5 +1,5 @@
340 @@ -1,5 +1,5 @@
335 a
341 a
336 -b
342 -b
337 +b b
343 +b b
338 c
344 c
339 d
345 d
340 e
346 e
341 diff -r 1fd39ab63a33 -r 2c3f66afeed9 dir/a.txt
347 diff -r 1fd39ab63a33 -r 2c3f66afeed9 dir/a.txt
342 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
348 --- a/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
343 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
349 +++ b/dir/a.txt Thu Jan 01 00:00:00 1970 +0000
344 @@ -1,4 +1,4 @@
350 @@ -1,4 +1,4 @@
345 -hello world
351 -hello world
346 +hello world!
352 +hello world!
347
353
348 someone
354 someone
349 up
355 up
350
356
351
357
352 After qrefresh 'diff'
358 After qrefresh 'diff'
353
359
354 $ hg diff --nodates
360 $ hg diff --nodates
355
361
356 $ cd ..
362 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now