Commit Graph

120 Commits

Author SHA1 Message Date
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
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
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Thomas Arendsen Hein
deb94bc7fe Removed trailing spaces from everything except test output 2008-03-07 00:24:36 +01:00
Thomas Arendsen Hein
66db9ab9a2 Document log date ranges and mention 'hg help dates' for all commands (issue998) 2008-02-22 21:18:48 +01:00
Kirill Smelkov
38c0bf7540 qrecord: record complements commit, so qrecord should complement qnew
Also there is an idea flying around to create something that will complement
qrefresh:

- maybe 'qammend'? or
- 'qrefresh --interactive'?

If we settle on '--interactive', then it would be conveniet to add this flag to
'commit' and 'qnew' as well.
2008-01-23 21:49:39 +03:00
Kirill Smelkov
73c5fc4e17 hg qrecord -- like record, but for mq
I'm a former Darcs user, and I've discovered that it is very convenient to
actually perform development using MQ first, and only when the patches are
'ready' move them to project's history in stone.


Usually I work on some topic, temporarily forgetting about any version control,
and just do coding, experimenting, debugging, etc.

After some time, I approach a moment, where my work should actually go to
patches/commits, and here is the problem::

    As it is now, there is no way to put part of the changes into one patch,
    and another part of the changes into second patch.

    This works, but only when changes are touching separate files, and for
    semantically different changes touching the same file(s) there is now
    pretty way to put them into separate patches.

For some time, I've tolerated the pain to run vim patches/... and move hunks
between files by hand, but I think this affects my productivity badly.


So, here is the first step towards untiing the problem:

    Let's use 'hg qrecord' for mq, like we use 'hg record' for usual commits!
2008-01-10 12:07:18 +03:00
Kirill Smelkov
e0f2ac6b4f record: refactor record into generic record driver
rationale
---------

I'd like to make MQ version of record -- qrecord.

>From the first glance it seemed to be easy -- the task in essence would be to
change call to cmdutil.commit() to something like mq.qrefresh().

As it turned out queue.refresh() and cmdutil.commit() have different semantics
-- cmdutil.commit() first scans for changes and then delegate the actual commit
to lowlevel func. On the other hand queue.refresh() do it all in once, and I am
a bit scary to change it.

Maybe the right way would be to first refactor queue.refresh() to use
cmdutil.commit() machinery, and then trivially adjust record, but I feel I'm
not competent for the task right now.

Instead, I propose we refactor record to be some sort of high-level driver, or
like a high-level decorator one can say, which will first interactively filter
changes, and then delegate commit job to high-level commiter, e.g. 'commit' or
'qrefresh'


So, this patch does just that -- refactor record to be generic driver, and
update 'hg record' code to use the driver.

'hg qrecord' will follow.
2008-01-10 12:07:13 +03:00
Kirill Smelkov
0b7c59b420 record: some docs
While studing record, I've written some docstrings and comments.
Hope they are useful.
2008-01-10 11:43:30 +03:00
Kirill Smelkov
cbdc1f53db prompt: kill matchflags
Python already lets one to embed RE flags directly in a regex, which
is a much nicer way to do things:

(?iLmsux)
        (One or more letters from the set "i", "L", "m", "s", "u", "x".)
        ...

matchflags was introduced in 14a7e862c60f, and the record extension is the only
user. I've killed matchflag, and adjusted record code appropriately.
2007-12-28 00:03:55 -06:00
Bryan O'Sullivan
f3ff6b7741 record: change wording of initial per-file prompt 2007-09-06 10:52:54 -07:00
Bryan O'Sullivan
46880a1c4f record: improve docs, improve prompts 2007-08-09 17:29:16 -07:00
Benoit Boissinot
ce6a51c4eb refactor options from cmdtable
- add extracommitopts for user and date
- factor stuff
2007-08-08 12:27:20 +02:00
Thomas Arendsen Hein
e34927453f Remove trailing spaces, fix indentation 2007-08-07 10:28:43 +02:00
Bryan O'Sullivan
4354d3e986 record: raise an exception correctly if we can't create a backup directory 2007-08-06 12:53:49 -07:00
Bryan O'Sullivan
4b5691e253 record: work properly if invoked in a subdirectory 2007-08-06 12:53:17 -07:00
Thomas Arendsen Hein
c6fa90f553 Update style of record's cmdtable to match mercurial/commands.py 2007-08-01 10:42:42 +02:00
Bryan O'Sullivan
a79766b2cd Add record extension, giving darcs-like interactive hunk picking 2007-07-31 16:28:05 -07:00