##// END OF EJS Templates
mq: qpush --move, reorder patch series and apply only the patch...
Mads Kiilerich -
r11064:590b1d6e default
parent child Browse files
Show More
@@ -978,7 +978,7 b' class queue(object):'
978 raise util.Abort(_("patch %s not in series") % patch)
978 raise util.Abort(_("patch %s not in series") % patch)
979
979
980 def push(self, repo, patch=None, force=False, list=False,
980 def push(self, repo, patch=None, force=False, list=False,
981 mergeq=None, all=False):
981 mergeq=None, all=False, move=False):
982 diffopts = self.diffopts()
982 diffopts = self.diffopts()
983 wlock = repo.wlock()
983 wlock = repo.wlock()
984 try:
984 try:
@@ -1034,6 +1034,15 b' class queue(object):'
1034 if not force:
1034 if not force:
1035 self.check_localchanges(repo)
1035 self.check_localchanges(repo)
1036
1036
1037 if move:
1038 try:
1039 del self.full_series[self.full_series.index(patch, start)]
1040 except ValueError:
1041 raise util.Abort(_("patch '%s' not found") % patch)
1042 self.full_series.insert(start, patch)
1043 self.parse_series()
1044 self.series_dirty = 1
1045
1037 self.applied_dirty = 1
1046 self.applied_dirty = 1
1038 if start > 0:
1047 if start > 0:
1039 self.check_toppatch(repo)
1048 self.check_toppatch(repo)
@@ -2222,7 +2231,7 b' def push(ui, repo, patch=None, **opts):'
2222 mergeq = queue(ui, repo.join(""), newpath)
2231 mergeq = queue(ui, repo.join(""), newpath)
2223 ui.warn(_("merging with queue at: %s\n") % mergeq.path)
2232 ui.warn(_("merging with queue at: %s\n") % mergeq.path)
2224 ret = q.push(repo, patch, force=opts['force'], list=opts['list'],
2233 ret = q.push(repo, patch, force=opts['force'], list=opts['list'],
2225 mergeq=mergeq, all=opts.get('all'))
2234 mergeq=mergeq, all=opts.get('all'), move=opts.get('move'))
2226 return ret
2235 return ret
2227
2236
2228 def pop(ui, repo, patch=None, **opts):
2237 def pop(ui, repo, patch=None, **opts):
@@ -2735,8 +2744,9 b' cmdtable = {'
2735 ('l', 'list', None, _('list patch name in commit text')),
2744 ('l', 'list', None, _('list patch name in commit text')),
2736 ('a', 'all', None, _('apply all patches')),
2745 ('a', 'all', None, _('apply all patches')),
2737 ('m', 'merge', None, _('merge from another queue (DEPRECATED)')),
2746 ('m', 'merge', None, _('merge from another queue (DEPRECATED)')),
2738 ('n', 'name', '', _('merge queue name (DEPRECATED)'))],
2747 ('n', 'name', '', _('merge queue name (DEPRECATED)')),
2739 _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [PATCH | INDEX]')),
2748 ('', 'move', None, _('reorder patch series and apply only the patch'))],
2749 _('hg qpush [-f] [-l] [-a] [-m] [-n NAME] [--move] [PATCH | INDEX]')),
2740 "^qrefresh":
2750 "^qrefresh":
2741 (refresh,
2751 (refresh,
2742 [('e', 'edit', None, _('edit commit message')),
2752 [('e', 'edit', None, _('edit commit message')),
@@ -219,6 +219,19 b' hg qpop test2.patch-1'
219 hg qpop test2.patch-2
219 hg qpop test2.patch-2
220 hg qpush test1b.patch+1
220 hg qpush test1b.patch+1
221
221
222 echo % qpush --move
223 hg qpop -a
224 hg qpush --move test2.patch # move to front
225 hg qpush --move test1b.patch
226 hg qpush --move test.patch # noop move
227 hg qseries -v
228 hg qpop -a
229 hg qpush --move test.patch # cleaning up
230 hg qpush --move test1b.patch
231 hg qpush --move bogus # nonexistent patch
232 hg qpush --move test.patch # already applied
233 hg qpush
234
222 echo % pop, qapplied, qunapplied
235 echo % pop, qapplied, qunapplied
223 hg qseries -v
236 hg qseries -v
224 echo % qapplied -1 test.patch
237 echo % qapplied -1 test.patch
@@ -193,6 +193,32 b' now at: test.patch'
193 applying test1b.patch
193 applying test1b.patch
194 applying test2.patch
194 applying test2.patch
195 now at: test2.patch
195 now at: test2.patch
196 % qpush --move
197 popping test2.patch
198 popping test1b.patch
199 popping test.patch
200 patch queue now empty
201 applying test2.patch
202 now at: test2.patch
203 applying test1b.patch
204 now at: test1b.patch
205 applying test.patch
206 now at: test.patch
207 0 A test2.patch
208 1 A test1b.patch
209 2 A test.patch
210 popping test.patch
211 popping test1b.patch
212 popping test2.patch
213 patch queue now empty
214 applying test.patch
215 now at: test.patch
216 applying test1b.patch
217 now at: test1b.patch
218 abort: patch bogus not in series
219 abort: cannot push to a previous patch: test.patch
220 applying test2.patch
221 now at: test2.patch
196 % pop, qapplied, qunapplied
222 % pop, qapplied, qunapplied
197 0 A test.patch
223 0 A test.patch
198 1 A test1b.patch
224 1 A test1b.patch
General Comments 0
You need to be logged in to leave comments. Login now