Commit Graph

32 Commits

Author SHA1 Message Date
Mads Kiilerich
09567db49a spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Gregory Szorc
d1b3f5b2a0 crecord: use absolute_import 2015-08-08 19:05:55 -07:00
Laurent Charignon
f9a0bb5c34 crecord: throws error instead of crashing for large diffs
Before this patch, crecord was crashing for large diffs
(30k lines on my laptop). This patch catches the exception raised in that case
and use the error reporting mechanism introduced in the previous patch for
notifying the user of the issue. It is not possible to add a test for that for
now as we don't yet have full blown ui tests for the curses interface.
2015-07-17 13:44:01 -07:00
Laurent Charignon
678b69749a crecord: add error reporting for failure in curses interface initialization
Before this patch, we couldn't report to the user any error that occurred:
- after we enabled the curses interface but
- before the interface is set up and drawn
This patch, provides a way to set errors that happens during the initialization
of the interface and log them once the curses interface has been displayed.
2015-07-17 13:41:17 -07:00
Laurent Charignon
ea68db323a crecord: fix issue when backgrounding editor would leave artefact
Before this patch:
- if a user was entering a commit message after having ran the curses
interface
- and then uses ctrl-z, followed by fg to put the editor in the
background/foreground
- then the curses interface would leave artefact on the screen of
the editor, making entering the commit message a difficult task

This happened because ncurses registers a signal handler for SIGTSTP and
does not restore the original signal handler after running.
More info at:
http://stackoverflow.com/questions/31440392/
curses-wrapper-messing-up-terminal-after-background-foreground-sequence/
31441709#31441709

This patch restores the original value of the signal handler after
running the curses interface and therefore fixes this issue.
It don't know how to add a test for this issue, I tested the scenario
above manually and it works correctly with the patch.
2015-07-15 20:39:23 -07:00
Laurent Charignon
05537e0c0f crecord: exit edition of hunk with non-zero status does not interrupt session
Before this patch, when editing a hunk, if the editor was exiting with a non-
zero status the crecord session would be aborted. This patch makes crecord
handle the failure and goes back to the state before the failed edition.
We use the new error reporting mechanism introduced in the previous patch to
notify the user of the issue.
2015-06-05 13:41:14 -07:00
Laurent Charignon
9a5e2d91be crecord: add mechanism for error reporting
Before this patch, there was no way to report errors in the crecord ui.
This patch introduces a new variable errorstr. If set, its content replaces the
top banner displayed in crecord until a key is pressed.
2015-06-05 13:53:49 -07:00
Laurent Charignon
b472b09bc6 crecord: extract ui refresh code after editing of hunk in a function
This is useful to reuse the logic to implement the continuation of the crecord
session if the user edits a hunk and the editor exits with a non-zero status.
2015-06-05 13:32:52 -07:00
Matt Mackall
002599d5f3 merge with stable 2015-06-05 15:44:43 -05:00
Laurent Charignon
e02fe4b93e crecord: fix three typos introduced while moving crecord into core
When moving crecord to core, I did a search an replace to remove all of the
variable with caps letter. Doing so, I unfortunately changed some commands
with capital letter shortcut to their lowercase counterpart. I fixed one
of these cases in bfcbb3995330. This patch fixes all of the remaining cases.
2015-06-05 12:57:21 -07:00
Laurent Charignon
8979893774 crecord: fix a typo introduced when moving crecord to core
When moving crecord to core, I did a search an replace to remove all of the
variable with caps letter. Doing so, I unfortunately changed the 'F' command
to 'f' leading to two 'f' commands, one never used. This patch fixes this
mistake and re enables the behavior of 'F'.
2015-06-05 10:44:34 -07:00
Matt Mackall
dfeafbe538 merge with stable 2015-06-05 13:00:18 -05:00
Laurent Charignon
55be79bae4 crecord: fix blue artifact bug coming back from help screen
Before this patch, with record's curses interface:
- When one pressed the ? key to see the help menu and then leaves the help menu
- Then, blue artifacts would remain on the screen

This patch forces a screen clear / refresh after coming back from the help menu.
Since we don't have UI test for crecord I checked on my machine that the bug
does not reproduce.
2015-06-03 14:22:21 -07:00
Laurent Charignon
9b866fafac record: add default value for operation argument
This patch is part of a series of patches to change the recording ui to reflect
the operation currently running (commit, shelve, revert ...).
This patch adds the default value of the operation argument for record's
standard and curses interface to match what is displayed in the interface
as of today.
2015-05-27 15:56:10 -07:00
Laurent Charignon
92c99cc1a7 record: add an operation arguments to customize recording ui
This patch is part of a series of patches to change the recording ui to reflect
the operation currently running (commit, shelve, revert ...).
This patch adds a new argument to the recording function to reflect in the UI
what operation we are running.
2015-05-27 15:49:24 -07:00
Laurent Charignon
7e6cda9955 record: change wording for record curses interface
We are using record and crecord in different context, not just for commiting
changes but also reverting and shelving changes. This diff changes the wording
from commiting to confirming changes to avoid confusing the users with what
they are doing.
2015-04-21 16:20:43 -07:00
Laurent Charignon
8213891de3 record: add message when starting record's curses interface
We are adding this log message to reduce a confusion when a command prints
something just before starting the curses interface.

Since the interactive mode is taking over the entire screen, starts with no
delay and does wait for a key press, the user believes that messages printed
before opening the interactive mode were actually printed after using
interactive mode, not before.
The fix adds the line "Starting interactive mode" helping the user separate
the messages that were printed before and after the start of the
interactive mode.

One particular example where this was a problem is the revert command where we
first print the list of changes to be considered for revert, then opens the
curses interface right away without letting the user see the messages.
The user then selects the changes, validates and then see the messages from
before opening the interactive mode and is confused.
2015-04-16 14:26:50 -07:00
Laurent Charignon
ff5c5b9b22 record_curses: fix ui bug for newly added file
With record's curses interface toggling and untoggling a newly added
file would lead to a confusing UI (the header was marked as partial
and the hunks as unselected). Tested additionally using the curses
interface with newly added, removed and modified files in a test repo.
2015-03-27 14:11:13 -07:00
Matt Harbison
ca3f9b0788 crecord: don't abort on Windows when curses isn't available
This is the hack portion of the previous patch, which can be backed out once we
figure out how to deal with curses.  Without this, the tests affected by the
import problem mentioned in the previous patch fail in exactly the same way, but
with the nicer 'module not available' error.
2015-03-20 23:35:13 -04:00
Matt Harbison
430072a9cc crecord: conditionalize the imports that are not available on Windows
'fcntl', 'termios' and 'wcurses' are not available on the default Windows python
installation, and importing them caused widespread carnage in the test suite.
There were 29 different changed test files (on top of unrelated errors), mostly
in the form of an ImportError.

The failures weren't related to actual crecord use, and followed the import
chain:

    'localrepo' -> 'subrepo' -> 'cmdutil' -> 'crecord' -> 'fcntl'
2015-03-20 23:32:00 -04:00
Matt Mackall
4d6168b480 crecord: use colwidth instead of ucolwidth 2015-03-18 13:38:06 -05:00
Laurent Charignon
ef841f66d2 record: change arguments of curses recording function
This way the arguments are the same for both curses and non-curses versions.
2015-03-13 10:51:25 -07:00
Matt Mackall
67ef525318 crecord: fix another underbar 2015-03-16 13:32:28 -05:00
Matt Mackall
ac77e7555a crecord: fiddle with vertical whitespace 2015-03-16 13:25:19 -05:00
Matt Mackall
0827849b4a crecord: fix underbar style for orig_stdout 2015-03-16 13:23:42 -05:00
Matt Mackall
3f4a5ca441 crecord: use encoding.ucolwidth 2015-03-16 13:22:37 -05:00
Matt Mackall
fe50ce41ab crecord: more import style 2015-03-16 12:58:06 -05:00
Matt Mackall
b4fd9bf79a crecord: fix some import style 2015-03-16 12:55:21 -05:00
Laurent Charignon
348f794262 record: add crecord's ui logic to core
Code adapted from https://bitbucket.org/edgimar/crecord/src to respect
coding convention an record's interface
2015-03-12 14:19:11 -07:00
Matt Harbison
65f90257b1 crecord: fix mixed imports warning 2015-04-09 23:47:07 -04:00