##// END OF EJS Templates
mq: Allow qrefresh --silent to take parameters...
Mads Kiilerich -
r7113:f7fc5f5e default
parent child Browse files
Show More
@@ -1073,7 +1073,9 b' class queue:'
1073 man = repo.manifest.read(changes[0])
1073 man = repo.manifest.read(changes[0])
1074 aaa = aa[:]
1074 aaa = aa[:]
1075 if opts.get('short'):
1075 if opts.get('short'):
1076 match = cmdutil.matchfiles(repo, mm + aa + dd)
1076 # if amending a patch, we always match already-in-patch files
1077 match = cmdutil.matchfiles(repo, mm + aa + dd + matchfn.files())
1078 matchfn = match # FIXME: Why have two matchers if we only need one?
1077 else:
1079 else:
1078 match = cmdutil.matchall(repo)
1080 match = cmdutil.matchall(repo)
1079 m, a, r, d = repo.status(match=match)[:4]
1081 m, a, r, d = repo.status(match=match)[:4]
@@ -1750,6 +1752,9 b' def refresh(ui, repo, *pats, **opts):'
1750 the modifications that match those patterns; the remaining modifications
1752 the modifications that match those patterns; the remaining modifications
1751 will remain in the working directory.
1753 will remain in the working directory.
1752
1754
1755 If --short is specified, files currently included in the patch will
1756 be refreshed just like matched files and remain in the patch.
1757
1753 hg add/remove/copy/rename work as usual, though you might want to use
1758 hg add/remove/copy/rename work as usual, though you might want to use
1754 git-style patches (--git or [diff] git=1) to track copies and renames.
1759 git-style patches (--git or [diff] git=1) to track copies and renames.
1755 """
1760 """
@@ -2411,7 +2416,7 b' cmdtable = {'
2411 (refresh,
2416 (refresh,
2412 [('e', 'edit', None, _('edit commit message')),
2417 [('e', 'edit', None, _('edit commit message')),
2413 ('g', 'git', None, _('use git extended diff format')),
2418 ('g', 'git', None, _('use git extended diff format')),
2414 ('s', 'short', None, _('refresh only files already in the patch')),
2419 ('s', 'short', None, _('refresh only files already in the patch and specified files')),
2415 ('U', 'currentuser', None, _('add/update "From: <current user>" in patch')),
2420 ('U', 'currentuser', None, _('add/update "From: <current user>" in patch')),
2416 ('u', 'user', '', _('add/update "From: <given user>" in patch')),
2421 ('u', 'user', '', _('add/update "From: <given user>" in patch')),
2417 ('D', 'currentdate', None, _('update "Date: <current date>" in patch (if present)')),
2422 ('D', 'currentdate', None, _('update "Date: <current date>" in patch (if present)')),
@@ -82,6 +82,29 b' echo % patch file contents'
82 cat .hg/patches/mqbase | \
82 cat .hg/patches/mqbase | \
83 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
83 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
84 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
84 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
85
86 echo % qrefresh --short
87 echo 'orphan' > orphanchild
88 hg add orphanchild
89 hg qrefresh nonexistingfilename
90 hg qrefresh --short 1/base
91 hg qrefresh --short 2/base
92
93 echo % qdiff
94 hg qdiff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
95 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
96
97 echo % patch file contents
98 cat .hg/patches/mqbase | \
99 sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
100 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
101
102 echo % diff shows orphan ...
103 hg st
104 hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \
105 -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/" \
106 -e "s/^\(diff\).*/\1/"
107
85 cd ..
108 cd ..
86
109
87
110
@@ -159,6 +159,48 b' diff -r b55ecdccb5cf 2/base'
159 @@ -1,1 +1,1 @@
159 @@ -1,1 +1,1 @@
160 -base
160 -base
161 +patched
161 +patched
162 % qrefresh --short
163 % qdiff
164 diff -r b55ecdccb5cf 1/base
165 --- a/1/base
166 +++ b/1/base
167 @@ -1,1 +1,1 @@
168 -base
169 +patched
170 diff -r b55ecdccb5cf 2/base
171 --- a/2/base
172 +++ b/2/base
173 @@ -1,1 +1,1 @@
174 -base
175 +patched
176 diff -r b55ecdccb5cf orphanchild
177 --- /dev/null
178 +++ b/orphanchild
179 @@ -0,0 +1,1 @@
180 +orphan
181 % patch file contents
182 mqbase
183
184 diff -r b55ecdccb5cf 1/base
185 --- a/1/base
186 +++ b/1/base
187 @@ -1,1 +1,1 @@
188 -base
189 +patched
190 diff -r b55ecdccb5cf 2/base
191 --- a/2/base
192 +++ b/2/base
193 @@ -1,1 +1,1 @@
194 -base
195 +patched
196 % diff shows orphan ...
197 A orphanchild
198 ? base
199 diff
200 --- /dev/null
201 +++ b/orphanchild
202 @@ -0,0 +1,1 @@
203 +orphan
162 % create test repo
204 % create test repo
163 adding a
205 adding a
164 % capture changes
206 % capture changes
General Comments 0
You need to be logged in to leave comments. Login now