Commit Graph

66 Commits

Author SHA1 Message Date
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
Martin Geisler
0d6a5ead82 typos: "it's" -> "its" 2009-07-08 23:17:10 +02:00
Martin Geisler
4709362b0c record: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Simon Heimberg
e0e4fc74e3 ui: extract choice from prompt
avoid translating single characters (as l for _local or sym_link)
2009-06-21 01:13:19 +02:00
Dirkjan Ochtman
0448417ea2 extensions: change descriptions for extensions providing a few commands 2009-06-24 13:42:02 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Patrick Mezard
7039de96dc Make mq, record and transplant honor patch.eol 2009-06-15 00:03:27 +02:00
Benoit Boissinot
0945c3cb8c record: use set instead of dict 2009-05-17 03:26:08 +02:00
Martin Geisler
ccf16e42d8 record: better formatting for qrecord help 2009-05-10 01:18:38 +02:00
Steve Borho
52bf113f2e ui: replace regexp pattern with sequence of choices
Use ampersands (&) to delineate the response char in each choice.
ui.prompt() responses are now explicitly case insensitive.  GUIs
that subclass ui can generate dialogs from the full choice names.
2009-04-30 10:15:32 -05:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
c15de6b1b7 ui: make interactive a method 2009-04-26 16:50:44 -05:00
Martin Geisler
e2222d3c43 replace set-like dictionaries with real sets
Many of the dictionaries created by dict.fromkeys were emulating sets.
These can now be replaced with real sets.
2009-04-22 00:57:28 +02:00
Martin Geisler
04b0d911a3 Change double spaces to single spaces in help texts. 2009-04-04 21:09:43 +02:00
Benoit Boissinot
a59bc0256c record: fix indentation 2009-03-29 00:08:33 +01:00
Rocco Rutte
a1eb264519 record: Give user a hint about chunk selection progress
It greatly improves usability when one roughly knows where
the chunks of interest are.
2009-03-28 23:09:36 +01:00
Dirkjan Ochtman
01539fdede record: minimize number of status calls 2009-02-12 11:52:31 +01:00
Steve Borho
4860997ffa record: do not lose permission changes on commit 2009-01-27 09:58:48 -06:00
Dirkjan Ochtman
2f6d26d640 patch: turn patch.diff() into a generator
This should even be a little faster than passing in an fp argument.
2008-11-03 16:48:23 +01:00
Martin Geisler
63784c935a i18n, record: improve use of translated docstring in prompts
The old code would confuse the user if the translator actually
translated the letters "Ynsfdaq?" in the prompt, since the user input
would be matched against the English string, despite the translation.

The new code fixes this, but the translator must be 100% consistent.
Also, the translation of single character strings is problematic if
they are used differently by different pieces of code.
2008-09-09 21:32:39 +02:00
Martin Geisler
559d8ac2b4 i18n: mark strings for translation in record extension 2008-08-31 16:12:03 +02:00
Dirkjan Ochtman
b5948bf4df merge with crew-stable 2008-08-31 12:05:29 +02:00
Dirkjan Ochtman
e364bcbc41 record: catch PatchErrors from internalpatch and display error message
This resulted in big ugly tracebacks in issue1282, for example.
2008-08-31 11:36:07 +02:00
Dirkjan Ochtman
9d15aadfb0 record: take diff lines for lack of trailing newlines into account (issue1282)
The record extension incorrectly re-calculated the size lines for unified
diff hunks. It counted a '\\ No newline at end of file\n' line towards the
number of lines of trailing context, while it's not actually part of the
context (and certainly isn't added as a line to the resulting output).

Use the local name of a variable that was access through the nonlocal scope
while we're at it. Seeing the variable was a little bewildering.
2008-08-31 11:34:52 +02:00
Matt Mackall
d4ab55a92b status: clean up all users for unknown files 2008-06-27 13:43:29 -05:00
Matt Mackall
fb88571d19 match: remove files arg from repo.status and friends 2008-05-12 11:37:08 -05:00
Matt Mackall
081e89551b match: remove files argument from patch.diff 2008-05-12 11:37:08 -05:00
Matt Mackall
6f8150b03d match: stop passing files through commitfunc 2008-05-12 11:37:08 -05:00