Commit Graph

93 Commits

Author SHA1 Message Date
Idan Kamara
a7eca9ebe7 record: fix options placeholder 2011-05-26 19:00:47 +03:00
Idan Kamara
67e075c860 record: alias qrecord to qnew -i/--interactive 2011-05-24 19:17:22 +03:00
Idan Kamara
dcebc5aaa6 record: add qrefresh -i/--interactive
interactively select changes to refresh
2011-05-24 19:17:19 +03:00
Idan Kamara
d4250f0ae0 record: add an option to backup all wc modifications
Also, don't create a backup dir if we have no files to backup.

This is essential for qrefresh --interactive. Since we can't
select individual files to qrefresh without eliminating already
present changes, we have to backup all changes in the working
copy to avoid refreshing unaccepted hunks.

(thanks to Patrick for the idea)
2011-05-24 19:17:04 +03:00
Idan Kamara
91b788592f record: check patch name is valid before prompting in qrecord 2011-05-24 19:17:02 +03:00
Idan Kamara
1e15ba1cc3 record: use cmdutil.command decorator 2011-05-22 16:10:03 +03:00
Idan Kamara
9966d26707 record: suggest the right command when running non interactively 2011-05-22 16:10:02 +03:00
Patrick Mezard
2bda8cbde2 patch: add a workingbackend dirstate layer on top of fsbackend
_updatedir() is no longer used by internalpatch()

The change in test-mq-missingfiles.t comes from workingbackend not considering
the missing 'b' file as changed, thus not calling addremove() on it.
2011-05-18 23:48:17 +02:00
Patrick Mezard
e0378ee5bd patch: make patch()/internalpatch() always update the dirstate 2011-05-08 17:48:31 +02:00
Patrick Mezard
88e958194e patch: move updatedir() from cmdutil into patch
Also, create an artificial wdutil.py to avoid import cycles between patch.py
and cmdutil.py.
2011-05-08 17:48:30 +02:00
Patrick Mezard
f63ca22ee0 record: unconditionally update the working dir after patching 2011-05-08 17:48:29 +02:00
timeless
ccf3a292e9 qrecord: provide help when mq is not enabled 2011-04-14 10:00:15 +02:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Martin Geisler
b69ebeba05 record: replace poor man's if-statement with real if-statement 2011-03-27 12:41:55 +02:00
Patrick Mezard
4554668a40 record: do not include files into changes count
This turns the prompt sequence from something like:

  $ examine changes to foo?
  $ record change 1/4 to foo?
  $ record change 2/4 to foo?
  $ examine changes to bar?
  $ record change 4/4 to bar?

into:

  $ examine changes to foo?
  $ record change 1/3 to foo?
  $ record change 2/3 to foo?
  $ examine change to bar?
  $ record change 3/3 to bar?
2011-01-24 23:25:46 +01:00
Patrick Mezard
1854f5716d record: simplify header methods with util.any 2011-01-23 15:21:56 +01:00
Patrick Mezard
5cca40e708 record: refactor the prompt loop
The previous loop was iterating over a mixed header/hunk stream. It may have
been more generic in the sense every item in the stream could trigger a prompt
but it required more work to skip items properly. It can be rewritten in a more
intuitive way by looping on files then looping on hunks.
2011-01-23 15:21:37 +01:00
Patrick Mezard
fc1575c195 record: turn prompt() into a pure function 2011-01-23 13:01:17 +01:00
Patrick Mezard
52f4fcb07c record: turn consumefile() into a pure function 2011-01-23 12:44:05 +01:00
Kevin Bullock
4655fb606c record: clean up command table
The --force option to qnew has become a no-op, so qrecord doesn't need
to use it. This allows record's command table to be simplified; in the
process of doing so, this patch also cleans up the cmdtable visually.
2010-12-21 15:27:58 -06:00
Kevin Bullock
709bd128af record: clean up comments and docstrings
Rewrap comments and docstrings to a width of 72 chars and copy-edit.
2010-12-21 15:23:48 -06:00
Steve Borho
6796ac95d5 record: teach parsepatch() about non-git style headers
These changes are not useful to record itself, since it is hard coded
to always generate git style diffs.  But it makes parsepatch() more
generally useful for parsing normal patch files.
2010-12-08 22:14:18 -06:00
Brodie Rao
1d9f172d6c record: move copystat() hack out of util.copyfile() and into record
226847bf9cab updated copyfile to also copy over atimes and
mtimes. That behavior is specifically to trick editors into thinking
files that hg record has modified haven't changed. We don't really
care about preserving times in the general case.
2010-12-07 20:03:05 +11:00
Thomas Arendsen Hein
6fd4e6aaec coding style: fix gratuitous whitespace after Python keywords 2010-12-03 11:30:45 +01:00
timeless
2f8d0b40e3 record: quote command in use hg commit message 2010-11-21 05:07:06 -06:00
Patrick Mezard
095f60fafa patch: always raise PatchError with a message, simplify handling 2010-10-09 15:13:08 -05:00
Martin Geisler
112ea7d5ed patch: break import cycle with cmdutil
The patch module imported cmdutil but used it only in updatedir.
2010-09-13 13:08:09 +02:00
timeless
220a53c8c9 record: count lines changed as the number of lines added or removed
per "record" hunk
Record deals in hunks which are tighter than traditional patch hunks,
really only a single run of additions/removals. Another addition, even a
line after a fixed line is treated as a new hunk by record.
2010-07-22 18:47:46 +03:00
Renato Cunha
0ef348b9d4 record: removed 'has_key' usage
Py3k has removed the dictionary has_key method. This patch implements
a one argument function that can be used as a callback by hg.revert in
the record extension.
2010-07-14 22:58:29 -03:00
Renato Cunha
baef416ee4 record: removed 'reduce' calls (unsupported by py3k)
Quoting python's documentation, "Note that sum(range(n), m) is
equivalent to reduce(operator.add, range(n), m)". The "sum" function
is a builtin from 2.3 on and there's no reason for not to use it.
2010-07-01 19:27:03 -03:00
Renato Cunha
17e6945d72 record: tuple parameter unpacking is deprecated in py3k 2010-07-01 19:27:03 -03:00
Martin Geisler
9050bae24d Merge with stable 2010-05-31 13:55:47 +02:00
Nicolas Dumazet
20bba72bdf record: check that we are not committing a merge before patch selection
It might sound like a good idea to use record to filter changes when merging.
If someone attemps this, it's better to tell her "no" right ahead, before the
patch generation/line selection, so she does not spend time doing it just to
receive a red light after that (sometimes rather long) process.
2010-05-31 17:13:15 +09:00
Martin Geisler
575c7bca7d record: better way to find help in docstring
This outputs only the lines in the verbatim block without relying on
the translator to have translated the little 'y - record this change'
string.
2010-05-31 13:43:03 +02:00
Nicolas Dumazet
7a4893d709 record: docstring typo 2010-05-31 14:48:26 +09:00
Martin Geisler
f1853c5e82 Use hg role in help strings 2010-04-22 10:24:49 +02:00
Matt Mackall
e4c06cc26b mq: promote qnew, demote qinit in short help 2010-04-11 14:25:02 -05:00
Brodie Rao
215b2d7a98 record: make use of output labeling 2010-04-02 15:22:15 -05:00
Martin Geisler
74b4c06343 record: separate each hunk with a blank line
This makes it easier for the eye to find the beginning of a hunk when
scrolling up in the terminal.
2010-03-14 23:10:52 +01:00
Dan Villiom Podlaski Christiansen
5d4c432925 record: function variable naming & signature cleanup.
No functionality change. All tests pass.
2010-02-05 18:46:22 +01:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
2f62f669cf record: handle translated prompt correctly
The prompt function would return 'y' or 'n' untranslated. This should
therefore not be compared to _('y') and _('n'). However, it turns out
that prompt could just as well return a good old Boolean.
2009-11-11 22:53:01 +01:00
Martin Geisler
c8914d5f89 record: use uisetup instead of extsetup to register qrecord
New commands should be registered in uisetup so that other extensions
have a change of wrapping them in extsetup.
2009-11-05 01:10:43 +01:00
Benoit Boissinot
fe9a5e5ec3 record: get the right position (account for skipped files) 2009-11-01 02:57:11 +01:00
Mads Kiilerich
0f7110ec11 Merge with redone 9660769e6539 (issue1860) 2009-10-16 11:19:39 +02:00
Martin Geisler
9f1896c083 do not attempt to translate ui.debug output 2009-09-19 01:15:38 +02:00
timeless@mozdev.org
8ec7a3012a record: remove superfluous space 2009-09-13 03:04:40 +03:00
Martin Geisler
4a71f54837 record: wrap docstrings at 70 characters 2009-07-26 02:00:58 +02:00
Martin Geisler
3951831e0b commands: use minirst parser when displaying help 2009-07-16 23:25:26 +02:00