Commit Graph

155 Commits

Author SHA1 Message Date
Jun Wu
2946a1c198 codemod: use single blank line
Summary: This makes test-check-code cleaner.

Reviewed By: ryanmce

Differential Revision: D6937934

fbshipit-source-id: 8f92bc32f75b9792ac67db77bb3a8756b37fa941
2018-04-13 21:51:08 -07:00
Pulkit Goyal
431feb4f20 py3: handle keyword arguments correctly in hgext/record.py
Differential Revision: https://phab.mercurial-scm.org/D1673
2017-12-10 06:36:48 +05:30
Yuya Nishihara
6c2103bc71 commands: move templates of common command options to cmdutil (API)
The goal is to get rid of the debugcommands -> commands dependency.

Since globalopts is the property of the commands, it's kept in the commands
module.
2017-05-14 16:19:47 +09:00
Yuya Nishihara
3e663dde68 registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
2016-01-09 23:07:20 +09:00
Jun Wu
436e791f48 record: get rid of ui.backupconfig 2017-03-16 14:34:35 -07:00
eloimorlaas
293313403e record: update help to describe ui.interface
hg help record was not accurate if using another interface than the text one
2017-02-23 11:23:17 -08:00
Philippe Pepiot
fd197b867c record: return code from underlying commit 2016-10-12 12:22:54 +02:00
Augie Fackler
4e1c384d0a extensions: change magic "shipped with hg" string
I've caught multiple extensions in the wild lying about being
'internal', so it's time to move the goalposts on people. Goalpost
moving will continue until third party extensions stop trying to
defeat the system.
2016-08-23 11:26:08 -04:00
Yuya Nishihara
a5c934df3c py3: move up symbol imports to enforce import-checker rules
Since (b) is banned, we should do the same for (a) for consistency.

 a) from mercurial import hg
    from mercurial.i18n import _

 b) from . import hg
    from .i18n import _
2016-05-14 14:03:12 +09:00
Pierre-Yves David
6fceb4873e record: deprecate the extension
The feature has been moved into core behind the -i flag. We can safely
deprecated the extension and point people at the --interactive flag in core.
2016-03-28 12:50:56 -07:00
timeless
9df52ee9f1 record: use absolute_import 2016-03-02 21:38:32 +00: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
FUJIWARA Katsunori
a26b3feac9 record: omit meaningless 'qrefresh' suggestion at 'hg qrefresh -i'
Before this patch, 'hg qrefresh -i' under non-interactive mode
suggests 'use qrefresh instead', and it obviously meaningless.

To omit meaningless 'qrefresh' suggestion at 'hg qrefresh -i', this
patch specifies 'None' for 'cmdsuggest' argument of 'cmdutil.dorecord()'.
2015-07-15 04:45:58 +09:00
FUJIWARA Katsunori
b6717eba7b record: omit meaningless 'qnew' suggestion at 'hg qnew -i'
Before this patch, 'hg qnew -i' under non-interactive mode suggests
'use qnew instead', and it obviously meaningless.

To omit meaningless 'qnew' suggestion at 'hg qnew -i', this patch adds
internal function '_qrecord()' and specifies 'cmdsuggest' for each of
'qrecord' and 'qnew' separately.
2015-07-15 04:45:58 +09:00
FUJIWARA Katsunori
b3a7702a57 record: omit meaningless 'commit' suggestion at 'hg commit -i'
Before this patch, 'hg commit -i' under non-interactive mode suggests
'use commit instead', and it obviously meaningless.

This patch makes 'record.record'()' examine 'ui.interactive()' and
show suggestion by itself before calling 'commands.commit()'.

This allows 'commands.commit()' to specify 'None' for 'cmdsuggest'
argument of 'cmdutil.dorecord()' to omit meaningless 'commit'
suggestion at 'hg commit -i'.
2015-07-15 04:45:58 +09:00
Laurent Charignon
1e69c9cdfb record: make hg record always use the non curses interface
Before this patch, hg record was running hg commit -i, therefore with the
experimental.crecord=True flag, hg record was actually launching the curses
record interface. Some of our users could be confused by that.
This patch makes the hg record command set this flag to False, ensuring that
hg record never shows the curses interface.
commit -i, shelve -i and revert -i remain unchanged and use the curses
interface if the experimental.crecord flag is set.
2015-05-13 20:30:12 -07:00
Augie Fackler
f95a6caba1 extensions: document that testedwith = 'internal' is special
Extension authors (notably at companies using hg) have been
cargo-culting the `testedwith = 'internal'` bit from hg's own
extensions, which then defeats our "file bugs over here" logic in
dispatch. Let's be more aggressive about trying to give extension
authors a hint about what testedwith should say.
2015-04-28 16:44:37 -04:00
Laurent Charignon
8e36c9d449 record: change interface of dorecord to accept new filters
This makes it easier to add different filtering logic (record /crecord ...)
2015-03-11 16:39:38 -07:00
Laurent Charignon
d98e8547de record: make record use commit -i 2015-03-11 15:54:11 -07:00
Laurent Charignon
00e39c0a37 record: add interactive option to the commit command 2015-03-11 15:22:04 -07:00
Laurent Charignon
b5de5559b7 record: move dorecord from record to cmdutil
Part of a serie of patches to move record from hgext to core
2015-03-10 17:14:33 -07:00
Laurent Charignon
e4283d0dfb record: remove dependency on hg module in record
Part of a series of patches to move record from hgext to core
2015-03-10 17:09:07 -07:00
Laurent Charignon
c30de5b61f record: remove dependency on extensions module in dorecord
Part of a series of patches to move record from hgext to core
2015-03-10 17:03:40 -07:00
Laurent Charignon
742d78e9af record: move filterpatch from record to patch
Part of a series of patches to move record from hgext to core
2015-03-10 14:42:07 -07:00
Siddharth Agarwal
8e295dc1a9 patch.internalpatch: add a default value for prefix
Rev cb4d72125aae adding a parameter here. This breaks third-party extensions
like crecord and also makes the issue fairly hard to fix on the extension's
side if it wants to retain compatibility across Mercurial versions -- in old
versions, the positional argument will be passed into the next unknown
argument, which is 'files'.

The patch also undoes a change to the record extension that is no longer
necessary.
2015-03-10 17:34:42 -07:00
Laurent Charignon
39d2901c91 record: move parsepatch from record to patch
Part of a series of patches to move record from hgext to core
2015-03-09 13:16:25 -07:00
Laurent Charignon
18e7b1d4da record: move scanpatch from record to patch
Part of a series of patches to move record from hgext to core
2015-03-09 13:14:31 -07:00
Laurent Charignon
b8126743d5 record: move hunk class from record to patch
Part of a series of patches to move record from hgext to core
2015-03-09 13:09:15 -07:00
Laurent Charignon
ccb2a5f8f4 record: move countChanges in the hunk class
Part of a series of patches to move record from hgext to core
2015-03-09 13:08:19 -07:00
Laurent Charignon
3b17682474 record: move header class from record to patch
Part of a series of patches to move record from hgext to core
2015-03-09 13:04:50 -07:00
Siddharth Agarwal
f5f1d70d92 patch.internalpatch: accept a prefix parameter 2015-03-06 22:43:47 -08:00
Laurent Charignon
e0bce75a1d record: allow editing new files (issue4304)
While using the record extension to select changes, the user couldn't see the
content of newly added files and had to select/reject them based on filename.
The test is changed accordingly in two places.
2015-03-06 15:57:43 -08:00
Siddharth Agarwal
0b150be7b2 record: don't honor format-changing diffopts (issue4459)
record does support the whitespace options, so honor those. In upcoming patches
we'll replace all the other uses.
2014-11-18 20:00:37 -08:00
Yuya Nishihara
ceda6fbba9 util.system: use ui.system() in place of optional ui.fout parameter 2014-11-08 13:06:22 +09:00
Martin von Zweigbergk
5ea3a9fbd3 record: access status fields by name rather than index
It is safe to pass the full status to patch.diff() since it does its
own slicing.
2014-10-03 10:44:07 -07:00
Jordi Gutiérrez Hermoso
a3f845b50e record: update comment to match code
Commit 9bcdffd81aaf changed how newfiles get passed to commitfunc, but
did not change the corresponding comment that explains this. This
commit also updates this comment.
2014-06-26 11:10:28 -04:00
Gregory Szorc
6000635fc2 record: define inferrepo in command decorator 2014-05-04 22:36:07 -07:00
Gregory Szorc
5785fc1837 record: declare commands using decorator 2014-05-04 22:35:37 -07:00
Pierre-Yves David
0d013e32a2 record: use absolute path instead of os.chdir
Record was changing the current directory to `repo.root` in order to be able to
feed `command.commit` file name relative to this `repo.root`. This is a bit
overkill and prevent an incoming fix to rebase. This would also break
multi-threaded usage.

Instead we just feed `command.commit` with absolute path name. works as well as
before but without chdir.
2014-01-31 14:52:53 -08:00
Jordi Gutiérrez Hermoso
aeb19f9922 record: re-enable whitespace-ignoring options
It looks like somewhere down the line, patch.diffopts changed the
names of the options that it recognises, but record.recordfunc wasn't
updated to the new names. Instead of trying to write down names at
all, we now use whatever names are provided in commands.diffwsopts and
pass that along to patch.diffopts, along with a couple of custom
options
2014-01-16 15:05:03 -05:00
Jordi Gutiérrez Hermoso
ccf7869bdf record: use commands.diffwsopts instead of ad-hoc diffopts
The record extension is writing its own version of commands.diffwsopts
which is identical to commands.diffwsopts. Based on the principle that
code duplication increases maintenance burden, this patch removes
record's ad-hoc diffopts in favour of commands.diffwsopts
2014-01-16 14:57:52 -05:00
FUJIWARA Katsunori
c2ab815c76 record: use "ui.extractchoices()" to get the list of available responses
Before this patch, record extension gets the list of available
responses from online help document of "hg record" in the tricky way,
even though the value passed to "ui.promptchoice()" has enough (maybe
i18n-ed) information.

This patch uses "ui.extractchoices()" to get the list of available
responses.
2013-12-02 00:50:30 +09:00
Prasoon Shukla
7c782e5502 record: --user/-u now works with record when ui.username not set (issue3857)
The -u flag didn't work when ui.username was not set and resulted in an
abort message. This was fixed by checking for the 'user' key in the opts
dictionary. If the key is present, the step causing the exception is not
executed.
2013-12-12 12:25:56 +05:30
Matt Mackall
d177c8d161 record: add checkunfinished support (issue3955) 2013-07-25 02:34:09 -05:00
Matt Mackall
13d2a13ea6 ui: merge prompt text components into a singe string
This will help avoid problems with partial or mismatched translation
of the components.
2013-05-22 17:31:43 -05:00
Mads Kiilerich
886d6922c4 record: ignore trailing content when parsing patches - introduce 'other' lines
This makes record work more like import which ignores for instance mail footers
in a patch file.

This also makes it possible for TortoiseHg to preview unapplied patches
containing such footers.
2012-06-13 23:06:34 +02:00
Mads Kiilerich
dbfffc0abf record: abort on malformed patches instead of crashing 2013-04-11 19:03:33 +02:00
Idan Kamara
ba14804c98 record: remove unused import 2013-01-09 21:13:52 +02:00
Denis Laxalde
b706c87e50 record: use patch.diffopts to account for user diffopts
This allows user defined diff options (e.g. showfunc) to be accounted for
when using record. A test has been updated accordingly.
2013-01-08 21:16:39 +01:00
Siddharth Agarwal
a5e71891bd commands: don't infer repo for commands like update (issue2748)
Maintain a whitelist of commands to infer the repo for instead. The whitelist
contains those commands that take file(s) in the working dir as arguments.
2012-10-16 11:43:15 -07:00