Commit Graph

3122 Commits

Author SHA1 Message Date
Philippe Pepiot
82dc121fd0 commit: return 1 for interactive commit with no changes (issue5397)
For consistency with non interactive commit
2016-10-14 09:52:38 +02:00
Pierre-Yves David
023c7518b5 bisect: extra a small initialisation outside of a loop
Having initialisation done during the first iteration is cute, but can be
avoided.
2016-08-24 05:09:46 +02:00
Augie Fackler
88491409f0 debuginstall: use %d instead of %s for formatting an int
% formatting on bytes on Python 3 is pickier about which % character
we specify.
2016-10-09 09:42:46 -04:00
Pierre-Yves David
a3ad6827e4 bisect: build a displayer only once
There is multiple spot using this, building it early will help to extract more
of the logic into the bisect module.
2016-08-24 05:06:21 +02:00
Pierre-Yves David
440aae6fd1 bisect: factor commonly update sequence
For now, This remains a closure in the module to avoid circular import with used
module.
2016-08-24 05:04:46 +02:00
Pierre-Yves David
7afebe8fb3 bisect: move check_state into the bisect module
Now that the function is simpler, we resume our quest to move the logic into the
bisect module. In the process, we add basic documentation.
2016-08-24 04:25:20 +02:00
Pierre-Yves David
1864a91d18 bisect: simplify conditional in 'check_state'
Now that extra code about "updating" flag have been removed, we can simplify the
condition flow and remove a level.
2016-08-24 04:23:13 +02:00
Pierre-Yves David
d737fb6fef bisect: remove code about "update-flag" in check_state
Now that the flag dedicated to updating the flag are handled earlier, we do not
need to handle them in the 'check_state' function.
2016-08-24 04:22:40 +02:00
Pierre-Yves David
c0f3c6bafe bisect: rename 'check_code' to match our naming scheme
We need to do it early, otherwise 'check-commit' will complain every time we
touch it.
2016-10-09 03:50:55 +02:00
Pierre-Yves David
e6d1c84c27 bisect: minor movement of code handle flag updating state
The code flag handling is quite complicated, we are moving code around to
prepare further simplification.
2016-08-24 04:48:17 +02:00
Pierre-Yves David
452cc705b7 bisect: move 'printresult' in the 'hbisect' module
The logic is already extracted into a closure. We move it into the module
dedicated to bisect.

A minor change is applied: the creation of the 'displayer' is kept in the main
command function, it remove the needs to import 'cmdutil' in 'hbisect'. This
would create an import circle otherwise.
2016-08-24 04:19:11 +02:00
Pierre-Yves David
88806a61a8 bisect: move the 'extendrange' to the 'hbisect' module
We have a module ready to host any bisect logic. That logic was already isolated
in a function so we just migrate it as is.
2016-08-24 04:16:07 +02:00
Pierre-Yves David
8a0460c873 bisect: extract the 'reset' logic into its own function
This is part of small clean up movement. The bisect module seem more appropriate
to host the bisect logic. The cleanup itself is motivated by some higher level
cleanup around vfs and locking.
2016-08-24 04:13:53 +02:00
Pierre-Yves David
8e48e80491 bisect: access the filesystem through vfs when reseting
We have nice and shiny abstractions now.
2016-08-24 04:31:49 +02:00
Simon Farnsworth
3622717b76 merge: add conflict labels to merge command
Now that we present the conflict labels in prompts, it's useful to have
better names than "local" and "other" for every command.
2016-10-07 08:51:50 -07:00
Augie Fackler
8bed0bf30f merge with stable 2016-10-01 15:10:38 -04:00
Kevin Bullock
9eb7f2dc02 grep: rewrite help to better document current (confusing) behavior 2016-09-23 12:45:10 -05:00
timeless
b2cc060f3a serve: use single quotes in use warning 2016-09-20 23:47:02 +00:00
timeless
dd077e79ae bundle: use single quotes in use warning 2016-09-20 23:46:15 +00:00
timeless
872aae0d97 push: update help hint to point to config.paths section 2016-09-20 20:12:38 +00:00
FUJIWARA Katsunori
9e475c7395 doc: fix incorrect use of rst hg role in help text 2016-08-01 06:08:27 +09:00
FUJIWARA Katsunori
7d27fc4948 doc: use field rst syntax to show keywords in debugdeltachain help correctly
List of available keywords is well formatted as a list of fields in
doc string, but is formatted as just normal text in online help
output.
2016-08-01 06:08:26 +09:00
Gábor Stefanik
8c51f3f327 graft: use opts.get() consistently
Make life easier for extension writers.
2016-07-25 17:00:42 +02:00
Denis Laxalde
399b84e4b1 annotate: handle empty files earlier
Rather than looping on funcmap and then checking for non-zero `l`
continue if the result of fctx.annotate is empty.
2016-07-11 15:45:34 +02:00
Martin von Zweigbergk
5dcec73439 debug: make debug{revlog,index,data} --dir not just a flag
The directory argument (for tree manifests) should belong to to the
--dir argument. I had mistakenly made --dir a flag. One effect of this
was that I had meant for "-m" to be optional, but instead it changed
the behavior of --dir, so with "hg debugdata -m --dir dir1 0", the -m
took over and the "dir1" got treated as a revision in the root
manifest log.
2016-06-24 11:12:41 -07:00
Martin von Zweigbergk
a785632cca debugdata: disallow trailing option with -c/-m
Before this change, "hg debugdata -c 0 foo" was allowed.
2016-06-24 11:25:55 -07:00
Mathias De Maré
109af2a941 config: add template support
V2:
- Limit escaping to plain formatting only
- Use the formatter consistently (no more ui.debug)
- Always include 'name' and 'value'

V3:
- Always convert 'value' to string (this also makes sure we handle functions)
- Keep real debug message as ui.debug for now
- Add additional tests.
  Note: I'm not quite sure about the best approach to handling
  the 'print the full config' case.
  For me, it printed the 'ui.promptecho' key at the end.
  I went with globs there as that at least tests the json display reliably.

Example output:
[
 {
  "name": "ui.username",
  "source": "/home/mathias/.hgrc:2",
  "value": "Mathias De Maré <mathias.demare@gmail.com>"
 }
]
2016-08-29 07:07:15 +02:00
Mathias De Maré
ba1cc0ec1c formatter: introduce isplain() to replace (the inverse of) __nonzero__() (API)
V2: also remove and replace __nonzero__
2016-08-29 17:19:09 +02:00
Gregory Szorc
9c6bc630a3 ui: path option to declare which revisions to push by default
Now that we have a mechanism for declaring path sub-options, we can
start to pile on features!

Many power users have expressed frustration that bare `hg push`
attempts to push all local revisions to the remote. This patch
introduces the "pushrev" path sub-option to control which revisions
are pushed when no "-r" argument is specified.

The value of this sub-option is a revset, naturally.

A future feature addition could potentially introduce a "pushnames"
sub-options that declares the list of names (branches, bookmarks,
topics, etc) to push by default. The entire "what to push by default"
feature should probably be considered before this patch lands.
2016-06-26 07:59:02 -07:00
FUJIWARA Katsunori
f46b49a0e3 check-code: detect "missing _() in ui message" more exactly
Before this patch, "missing _() in ui message" rule overlooks
translatable message, which starts with other than alphabet.

To detect "missing _() in ui message" more exactly, this patch
improves the regexp with assumptions below.

  - sequence consisting of below might precede "translatable message"
    in same string token

    - formatting string, which starts with '%'
    - escaped character, which starts with 'b' (as replacement of '\\'), or
    - characters other than '%', 'b' and 'x' (as replacement of alphabet)

  - any string tokens might precede a string token, which contains
    "translatable message"

This patch builds an input file, which is used to examine "missing _()
in ui message" detection, before '"$check_code" stringjoin.py' in
test-contrib-check-code.t, because this reduces amount of change churn
in subsequent patch.

This patch also applies "()" instead of "_()" on messages below to
hide false-positives:

  - messages for ui.debug() or debug commands/tools
    - contrib/debugshell.py
    - hgext/win32mbcs.py (ui.write() is used, though)
    - mercurial/commands.py
      - _debugchangegroup
      - debugindex
      - debuglocks
      - debugrevlog
      - debugrevspec
      - debugtemplate

  - untranslatable messages
    - doc/gendoc.py (ReST specific text)
    - hgext/hgk.py (permission string)
    - hgext/keyword.py (text written into configuration file)
    - mercurial/cmdutil.py (formatting strings for JSON)
2016-06-21 00:50:39 +09:00
liscju
ccdb8ddd17 pull: add help information about pulling active bookmark 2016-06-20 23:24:55 +02:00
liscju
767e27633e bookmarks: add 'hg pull -B .' for pulling the active bookmark (issue5258) 2016-06-01 22:58:57 +02:00
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
Yuya Nishihara
daaa5c994b debugrevspec: add option to verify optimized result
This provides a convenient way to diff "hg debugrevspec" outputs generated
with/without --no-optimized option.
2016-08-21 13:16:21 +09:00
Yuya Nishihara
845ca229f7 debugrevspec: add option to skip optimize() and evaluate unoptimized tree
This will help debugging optimizer bugs.

Maybe '--no-optimized' can be changed to '--optimized' (default: True) when
flags series landed.
2016-08-21 12:40:02 +09:00
Yuya Nishihara
c883bfb39b revset: remove showwarning option from expandaliases()
Now all callers pass showwarning=ui.warn, so we no longer need the option to
suppress warnings.
2016-09-08 22:44:10 +09:00
Yuya Nishihara
8c0043a25b debugrevspec: evaluate tree built by itself
Prepares for new option to evaluate an unoptimized tree.

Since a revset expression is no longer parsed twice, alias warnings should
be displayed at the first parsing stages. That's why showwarning=ui.warn is
added.
2016-08-21 12:45:43 +09:00
Yuya Nishihara
94a7c74fda debugrevspec: deprecate --optimize option
This option has been superseded by '--show-stage NAME', and will cause
confusion in future patches.
2016-08-21 12:36:23 +09:00