Commit Graph

3053 Commits

Author SHA1 Message Date
timeless
0dcdb26a9d debuginstall: expose modulepolicy
With this, you can check for pure easily:
$ HGMODULEPOLICY=py ./hg debuginstall -T "{hgmodulepolicy}"
py
2016-03-09 19:55:45 +00:00
FUJIWARA Katsunori
ef0b8901a2 debugignore: make messages translatable
These messages have been overlooked by check-code, because they start
with non-alphabet character ('%' or '(').

Making these messages translatable seems reasonable, because messages
for ui.note(), ui.status(), ui.progress() and descriptive messages for
ui.write() in "debug" commands are already translatable in many cases.

This is also a part of preparation for making "missing _() in ui
message" detection of check-code more exact.
2016-05-26 01:57:34 +09:00
FUJIWARA Katsunori
13e0147d50 grep: make a message translatable
This message has been overlooked by check-code, because it starts with
non-alphabet character (' ').

This is also a part of preparation for making "missing _() in ui
message" detection of check-code more exact.
2016-05-26 01:57:34 +09:00
timeless
bd5be422b3 debuginstall: add mercurial version 2016-05-10 22:45:45 +00:00
Matt Mackall
a24591e84c merge with stable 2016-05-17 11:28:46 -05:00
FUJIWARA Katsunori
17fa5d0520 help: search section of help topic by translated section name correctly
Before this patch, "hg help topic.section" might show unexpected
section of help topic in some encoding.

It applies str.lower() instead of encoding.lower(str) on translated
message to search section case-insensitively, but some encoding uses
0x41(A) - 0x5a(Z) as the second or later byte of multi-byte character
(for example, ja_JP.cp932), and str.lower() causes unexpected result.

To search section of help topic by translated section name correctly,
this patch replaces str.lower() by encoding.lower(str) for both query
string (in commands.help()) and translated help text (in
minirst.getsections()).
2016-05-13 07:19:59 +09:00
Adam Simpkins
49958f0c37 graft: fix printing of --continue command
Properly shell quote arguments, to avoid printing commands that won't work when
run literally.  For example, a date string with timestamp needs to be quoted:
--date '1456953053 28800'
2016-04-27 19:24:31 -07:00
Martin von Zweigbergk
5746133750 update: correct description of --check option
The old "update across branches if no uncommitted changes" made
it sound like updating across branches (with no uncommitted changes)
was allowed only with this option, which was not true. Also, the option
did not care whether it was linear or across branches. Instead, it
checked that there were no uncommitted changes. Let's explain what it
does instead of trying to suggest what happens without it.
2016-04-27 14:02:54 -07:00
Yuya Nishihara
d1b0332b16 revset: factor out public optimize() function from recursion
New optimize() hides internal arguments and return values. This makes it easy
to add more parameters and return values to _optimize().
2016-05-02 12:09:00 +09:00
Augie Fackler
643a3efe0a rollback: add a config knob for entirely disabling the command
This is of pretty high value for organizations that used to use p4 (as
an example), since `p4 rollback` is what we call `hg backout`.
2016-05-03 16:33:25 -04:00
Jun Wu
de167181c6 ui: add new config option for help text width
Before this patch, when printing help text using `hg help`, or `hg log -h`,
the output will wrap at 78 chars even if the user has a bigger terminal width
and there is no config option to change it, making the experience different
from the commonly used `man` tool.

This patch introduces a new config option `ui.textwidth`, which replaces the
hardcoded number. It's set to 78 by default to maintain compatibility. When
set to 0, `hg help` will behave more like `man`.
2016-05-04 18:18:24 +01:00
Nathan Goldbaum
6f4adfc536 revert: mention ui.origbackuppath in the command help 2016-05-04 10:46:27 -05:00
Mike Hommey
cf14a5ca18 debugbundle: handle the --all option for bundle2 2016-04-18 17:54:02 +09:00
timeless
f26cdc0d89 debugcreatestreamclonebundle: use single quotes around command hint
Windows command lines use double quotes to quote arguments with spaces.
This change is in a series to unify around using single quotes around
commands, and double quotes around interior arguments.
2016-04-14 15:17:15 +00:00
Yuya Nishihara
84a8ba9511 templater: factor out function that creates templater from string template
This function will host loading of template aliases. It is not defined at
templater, but at formatter, since formatter is the module handling ui stuff
in front of templater.
2016-04-10 17:23:09 +09:00
Yuya Nishihara
3f981af86b templater: separate function to create templater from map file (API)
New frommapfile() function will make it clear when template aliases will be
loaded. They should be applied to command arguments and templates in hgrc,
but not to map files. Otherwise, our stock styles and web templates
(i.e map-file templates) could be modified unintentionally.

Future patches will add "aliases" argument to __init__(), but not to
frommapfile().
2016-04-03 23:26:48 +09:00
Yuya Nishihara
d00a0ddedf templater: add parsing and expansion rules to process "templatealias" section
The debugtemplate command is updated to show expanded tree, but still the
template engine doesn't support alias expansion. That's why the test says
"parse error" for now.
2016-03-27 20:31:56 +09:00
liscju
22e1e3529b remove: fix --force option help description (issue5177)
Before this commit --force option help description stated
that file was removed and deleted even if file was added
or modified which is not true. Force option removes added
file only from dirstate, it doesn't delete it from the
filesystem.
2016-04-13 09:56:51 +02:00
Yuya Nishihara
4d9561138b revset: rename findaliases() to expandaliases()
This function returns a full tree of alias expansion applied, which sounds
different from what "findaliases" would do.
2016-02-29 22:58:15 +09:00
Kostia Balytskyi
47727221bc obsstore: move delete function from obsstore class to repair module
Since one of the original patches was accepted already and people on the
mailing list still have suggestions as to how this should be improved, I'm
implementing those suggestions in the following patches (this and the ones that
might follow).
2016-04-12 04:06:50 -07:00
Kostia Balytskyi
ab0e2307c2 debugobsolete: style fixes to debugobsolete that slipped from original commit 2016-04-12 03:40:53 -07:00
Matt Mackall
d6208af0bb import: document --exact behavior in more detail 2016-03-09 10:47:33 -05:00
Kostia Balytskyi
500aca2389 commands: make --rev and --index compatible in debugobsolete 2016-04-04 02:05:10 -07:00
timeless
96d9f89f4f graft: use double quotes for arguments
You can't use single quotes in cmd.exe. See f4369d3e818c.
2016-01-12 09:30:24 +00:00
Kostia Balytskyi
379ba461ec commands: allow debugobsolete to delete arbitrary obsmarkers
Sample usage is:
  '$ hg debugobsolete --delete 0 5'

This is a debug feature that will help people working on evolution and
obsolescense.
2016-04-01 15:12:50 -07:00
Kostia Balytskyi
1a905d2d03 commands: disallow 'hg debugobsolete --index --rev <smth>'
A bug in the original --index implementation. The goal of --index is to allow
unique obsmarker identification that would be consistent between invocations
of this command in the unchanged repo. Further goal is to use this index to
delete arbitrary obsmarkers. So calling --index together with --rev would
cause obsmarker indices to be different than just calling --index. This is
not desired and current pattern for getting the index of an interesting
obsmarker is: `$ hg debugobsolete --index | grep <interesting hash>`.
It would clearly be better if we could somehow compute a hash of an obsmarker
and use it to identify the one we want to delete, but it seems a bit too
heavy for our current goals, so we can do this later if we want.
2016-04-01 15:20:31 -07:00
Martin von Zweigbergk
3215d75682 bundle: avoid crash when no good changegroup version found
When using treemanifests, only changegroup3 bundles can be
created. However, there is currently no way of requesting a
changegroup3 bundle, so we run into an assertion in
changegroup.getbundler() when trying to get a changroup2
bundler. Let's avoid the traceback and print a short error message
instead.
2016-03-25 23:05:32 -07:00
Martin von Zweigbergk
4cc86f7b27 bundle: move writebundle() from changegroup.py to bundle2.py (API)
writebundle() writes a bundle2 bundle or a plain changegroup1. Imagine
away the "2" in "bundle2.py" for a moment and this change should makes
sense. The bundle wraps the changegroup, so it makes sense that it
knows about it. Another sign that this is correct is that the delayed
import of bundle2 in changegroup goes away.

I'll leave it for another time to remove the "2" in "bundle2.py"
(alternatively, extract a new bundle.py from it).
2016-03-28 14:41:29 -07:00
liscju
91a4807057 debugsetparents: remove redundant invocations of begin/endparentchange
Method localrepo.setparents invokes begin/endparentchange internally,
so there is no need to invoke it explicitly in debugsetparents.
2016-03-28 09:12:03 +02:00
timeless
9b55d3b408 summary: move mergemod before parents to give access to ms 2016-03-17 14:50:29 +00:00
Simon Farnsworth
74ca86ac73 merge: save merge part labels for later reuse
We permit the caller of merge operations to supply labels for the merge
parts ("local", "other", and optionally "base"). These labels are used in
conflict markers to reduce confusion; however, the labels were not
persistent, so 'hg resolve' would lose the labels.

Store the labels in the mergestate.
2016-03-19 18:37:10 -07:00
Yuya Nishihara
e2dfdaa910 debugrevspec: show expanded/concatenated states before printing trees
The debugrevspec command prints at most 4 parsed trees. It wasn't easy to
tell which tree belongs to which state.
2016-03-26 19:01:12 +09:00
Kostia Balytskyi
35f0e5c575 debugobsolete: add an option to show marker index
A bigger picture is the ability to be delete an arbitrary marker form the
repo's obsstore. This is a useful debug ability and it needs a way to indentify
the marker one wants to delete. Having a marker's index provides such an
ability.
2016-03-23 10:50:24 -07:00
Yuya Nishihara
7d5bdcf68d templater: add debugtemplate command
This is useful for debugging template parsing. Several tests are ported to
this command.
2016-02-14 01:06:12 +09:00
FUJIWARA Katsunori
e0a700aa24 commands: add postincoming docstring for explanation of arguments 2016-03-12 04:35:42 +09:00
FUJIWARA Katsunori
323523ef12 commands: centralize code to update with extra care for non-file components
This patch centralizes similar code paths to update the working
directory with extra care for non-file components (e.g. bookmark) into
newly added function updatetotally().

'if True' at the beginning of updatetotally() is redundant at this
patch, but useful to reduce amount of changes in subsequent patch.
2016-03-12 04:35:42 +09:00
FUJIWARA Katsunori
1430646025 update: omit redundant activating message for already active bookmark
This patch also adds "hg bookmarks" invocation into tests, where
redundant message is omitted but bookmark activity isn't clear from
context.
2016-03-12 04:35:42 +09:00
Jun Wu
704e54e1c7 serve: accept multiple values for --daemon-postexec
The next patch will add another postexec command: chdir, which can be used
together with unlink. This patch changes the option type of --daemon-postexec
from string to list to accept multiple commands. The error message of invalid
--daemon-postexec value is also changed to include the actual invalid value.
2016-03-09 02:07:40 +00:00
timeless
c4098a81cc debuginstall: convert to formatter
commit editor now reports its editor
default template is now reported

a broken vi editor (vi not in path) is still not considered a problem (!!)
2016-03-09 18:58:51 +00:00
timeless
1fcd9b7563 resolve: when pats do not match, hint about path:
Suggest a command that would probably work.
2015-12-24 04:31:34 +00:00
FUJIWARA Katsunori
f9e776bc8b dispatch: make loading extra information from extension extensible
This patch makes loading extra information from extension module at
dispatching extensible. Factoring 'loadcmdtable()' into commands.py is
a part of generalization of loading extra information.

This extensibility assumes registration of new function like below,
for example:

  - revset predicate
  - fileset predicate
  - template keyword
  - template filter
  - template function
  - internal merge tool
  - web command

This patch requires not loader function itself but container module
and the name of it, because listing loader function directly up
implies actual loading module of it, even if it isn't used at runtime
(for example, extensions don't always define revset predicate)
2016-03-08 23:04:53 +09:00
timeless
ec454c0097 commit: block amend while histedit is in progress (issue4800) 2016-02-14 07:35:50 +00:00
Matt Mackall
2f932b7682 merge with stable 2016-03-02 16:44:56 -06:00
FUJIWARA Katsunori
4a0bc54a73 doc: remove deprecated option from synopsis of command help
Before this patch, deprecated options below are used in synopsis of
command help, even though they aren't listed up as available options
by default. These might confuse readers.

  - -n (no-op, now) of strip
  - -a/--active of branches
  - -f/--force of merge
2016-03-01 03:28:46 +09:00
Siddharth Agarwal
08f24f1f67 graft: don't preserve most extra fields
This backs out changeset 9aa13e9feec8.

See the previous patch for why we're doing this.
2016-02-03 09:06:52 -08:00
Siddharth Agarwal
c8ebb66630 amend: don't preserve most extra fields
This backs out changeset fd794e885a9e9.

There are some extra fields that absolutely should not be preserved, like the
convert_revision field introduced by the convert and hgsubversion extensions.
The problem with extensions blacklisting certain extra fields is that they
might not be enabled at the time the amend is performed.

In the long run we probably want separately marked transferable and
non-transferable extra fields, but for now restore the old Mercurial 3.6
behavior.
2016-02-03 08:59:46 -08:00
Yuya Nishihara
c24eb61d0c backout: disable --merge with --no-commit (issue4874)
Because "backout --merge" have to make a commit before merging, it doesn't
work with --no-commit. We could change "backout --merge" to make a merge
commit automatically, and --no-commit to bypass a merge commit, but that
change would be undesirable because:

 a) it's hard to fix bad merges in general
 b) two commits would be created with the same --message

So, this patch simply disables "--merge --no-commit".
2016-01-30 18:00:11 +09:00
Nathan Goldbaum
2d19c5b8f4 bookmarks: improve documentation for --rev option 2016-01-27 16:16:38 -06:00
FUJIWARA Katsunori
07d633b500 commands: advance current active bookmark at pull --update correctly
Before this patch, "hg pull --update" doesn't advance current active
bookmark correctly, if pulling itself doesn't advance it, even though
"hg pull" + "hg update" does so.

Existing test for "pull --update works the same as pull && update" in
test-bookmarks.t doesn't examine this case, because pulling itself
advance current active bookmark before actual updating the working
directory in that test case.

To advance current active bookmark at "hg pull --update" correctly,
this patch examines 'movemarkfrom' instead of 'not checkout'.

Even if 'not checkout' at the invocation of postincoming(), 'checkout'
is overwritten by "the revision to update to" value returned by
destutil.destupdate() in such case. Therefore, 'not checkout'
condition means "update destination is revision #0", and isn't
suitable for examining whether active bookmark should be advanced.

Even though examination around "movemarkfrom == repo['.'].node()" may
seem a little redundant just for this issue, this makes it easier to
compare (and unify in the future, maybe) with the same logic to update
bookmark at "hg update" below.

        if not ret and movemarkfrom:
            if movemarkfrom == repo['.'].node():
                pass # no-op update
            elif bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
                ui.status(_("updating bookmark %s\n") % repo._activebookmark)
            else:
                # this can happen with a non-linear update
                ui.status(_("(leaving bookmark %s)\n") %
                          repo._activebookmark)
                bookmarks.deactivate(repo)
2016-01-28 20:10:06 +09:00
Matt Harbison
87e191502b commit: factor the post commit status check into a cmdutil method
The largefiles extension needs to set lfstatus for this status call.  Otherwise,
if a missing largefile is explicitly named, a confusing message is issued that
says the largefile wasn't found, followed by another that says nothing changed.
2016-01-23 23:24:30 -05:00