Show More
@@ -5,10 +5,10 b'' | |||||
5 | # This software may be used and distributed according to the terms of |
|
5 | # This software may be used and distributed according to the terms of | |
6 | # the GNU General Public License, incorporated herein by reference. |
|
6 | # the GNU General Public License, incorporated herein by reference. | |
7 |
|
7 | |||
8 | '''interactive change selection during commit''' |
|
8 | '''interactive change selection during commit or qrefresh''' | |
9 |
|
9 | |||
10 | from mercurial.i18n import _ |
|
10 | from mercurial.i18n import _ | |
11 | from mercurial import cmdutil, commands, cmdutil, hg, mdiff, patch, revlog |
|
11 | from mercurial import cmdutil, commands, cmdutil, extensions, hg, mdiff, patch, revlog | |
12 | from mercurial import util |
|
12 | from mercurial import util | |
13 | import copy, cStringIO, errno, operator, os, re, shutil, tempfile |
|
13 | import copy, cStringIO, errno, operator, os, re, shutil, tempfile | |
14 |
|
14 | |||
@@ -358,10 +358,27 b' def record(ui, repo, *pats, **opts):' | |||||
358 |
|
358 | |||
359 | ? - display help''' |
|
359 | ? - display help''' | |
360 |
|
360 | |||
361 | def record_commiter(ui, repo, pats, opts): |
|
361 | def record_committer(ui, repo, pats, opts): | |
362 | commands.commit(ui, repo, *pats, **opts) |
|
362 | commands.commit(ui, repo, *pats, **opts) | |
363 |
|
363 | |||
364 | dorecord(ui, repo, record_commiter, *pats, **opts) |
|
364 | dorecord(ui, repo, record_committer, *pats, **opts) | |
|
365 | ||||
|
366 | ||||
|
367 | def qrecord(ui, repo, *pats, **opts): | |||
|
368 | '''interactively select changes for qrefresh | |||
|
369 | ||||
|
370 | see 'hg help record' for more information and usage | |||
|
371 | ''' | |||
|
372 | ||||
|
373 | try: | |||
|
374 | mq = extensions.find('mq') | |||
|
375 | except KeyError: | |||
|
376 | raise util.Abort(_("'mq' extension not loaded")) | |||
|
377 | ||||
|
378 | def qrecord_committer(ui, repo, pats, opts): | |||
|
379 | mq.refresh(ui, repo, *pats, **opts) | |||
|
380 | ||||
|
381 | dorecord(ui, repo, qrecord_committer, *pats, **opts) | |||
365 |
|
382 | |||
366 |
|
383 | |||
367 | def dorecord(ui, repo, committer, *pats, **opts): |
|
384 | def dorecord(ui, repo, committer, *pats, **opts): | |
@@ -478,8 +495,29 b' def dorecord(ui, repo, committer, *pats,' | |||||
478 | cmdtable = { |
|
495 | cmdtable = { | |
479 | "record": |
|
496 | "record": | |
480 | (record, |
|
497 | (record, | |
481 | [('A', 'addremove', None, |
|
498 | ||
482 | _('mark new/missing files as added/removed before committing')), |
|
499 | # add commit options | |
483 | ] + commands.walkopts + commands.commitopts + commands.commitopts2, |
|
500 | commands.table['^commit|ci'][1], | |
|
501 | ||||
484 | _('hg record [OPTION]... [FILE]...')), |
|
502 | _('hg record [OPTION]... [FILE]...')), | |
485 | } |
|
503 | } | |
|
504 | ||||
|
505 | ||||
|
506 | def extsetup(): | |||
|
507 | try: | |||
|
508 | mq = extensions.find('mq') | |||
|
509 | except KeyError: | |||
|
510 | return | |||
|
511 | ||||
|
512 | qcmdtable = { | |||
|
513 | "qrecord": | |||
|
514 | (qrecord, | |||
|
515 | ||||
|
516 | # add qrefresh options | |||
|
517 | mq.cmdtable['^qrefresh'][1], | |||
|
518 | ||||
|
519 | _('hg qrecord [OPTION]... [FILE]...')), | |||
|
520 | } | |||
|
521 | ||||
|
522 | cmdtable.update(qcmdtable) | |||
|
523 |
General Comments 0
You need to be logged in to leave comments.
Login now