Commit Graph

3395 Commits

Author SHA1 Message Date
Yuya Nishihara
f1b986c603 annotate: restructure formatter output to be nested list (BC)
Annotate data should be in [(file, [line...])...] form, but there was no
API to represent such data structure when I ported it to formatter. Now
we have fm.nested() and the -T option is still experimental, so we can fix
the data format.
2017-06-03 00:25:24 +09:00
Yuya Nishihara
5f79cac875 annotate: rename formatter variable
So we can add a nested 'fm' of narrow scope.
2017-06-03 00:05:12 +09:00
Yuya Nishihara
eff4d5e967 cat: add formatter support
This is an example showing how formatter can handle the --output option.
git subrepo isn't supported for now.
2017-05-25 21:53:44 +09:00
Yuya Nishihara
877b7b1d1a help: pass commands module by argument
This removes import cycle.
2017-05-21 16:57:32 +09:00
Yuya Nishihara
4a4dca2dbc cat: do not start pager if output will be written to file 2017-05-27 18:52:46 +09:00
Yuya Nishihara
1d54e26edc cat: pass filename template as explicit argument
I'll move the handling of the '-' filename to commands.cat().
2017-05-27 18:50:05 +09:00
Pierre-Yves David
8873a232c1 bundle: add an experimental knob to include obsmarkers in bundle
The "hg bundle" command is a good place to test if the inclusion of obsmarkers
within a bundle is working well (part exists, content is correct etc). So we
add a way to have them included.

Ideally, this would be controlled by a change around bundlespec (bundlespec
"v3" + arguments). However, my main goal is to have obsmarkers included in
bundle created by the 'hg strip' command, not the 'hg bundle' so for now I'm
avoiding the detour through bundlespec rework territory.

Better debug output for obsmarkers in 'debugbundle' will be added in later
changesets. The 'test-obsolete-bundle-strip.t' test will also get updated in a
later changeset to keep the current changeset smaller.
2017-05-28 11:50:43 -07:00
Siddharth Agarwal
51c7d417b5 annotate: add a new experimental --skip option to skip revs
This option is most useful for mechanical code modifications, especially ones
that retain the same number of lines.
2017-05-24 19:39:33 -07:00
Yuya Nishihara
6f42d09a39 bookmarks: fix check of hash-like name to not abort by ambiguous identifier
'mark in repo' may raise LookupError. I set it to not be warned since bookmark
names shorter than 4 chars aren't checked and short names are likely to be
ambiguous.
2017-05-25 23:20:00 +09:00
Augie Fackler
5a83391bf4 bookmarks: warn about bookmark names that unambiguously resolve to a node (BC)
I just burned myself on this today because I left out the -r in my `hg
bookmark` command, which then left me confused because I didn't notice
the bookmark I created in the wrong place that was silently shadowing
the revision I was trying to check out. Let's warn the user.

This patch only enforces the check on bookmark names 4 characters long
or longer. We can tweak that if we'd like, I selected that since
that's the fewest characters shortest will use in the templater
output.

A previous version of this patch rejected such bookmarks. It was
proposed during review (and I agree) that the behavior change for a
bookmark named "cafe" or similar as history accumulated was a little
too weird, but that the warning definitely has merit.
2017-05-22 19:18:12 -04:00
Augie Fackler
414ee4894d cmdutil: rename template param to export to fntemplate
It's actually a template for the filename, not a formatter template.
2017-05-20 20:15:05 -04:00
Yuya Nishihara
c283f56e61 debugcommands: use temporary dict for its command table
Instead, load the table by commands.py so the debug commands should always
be populated. The table in debugcommands.py is unnamed so extension authors
wouldn't be confused to wrap debugcommands.table in place of commands.table.
2017-05-04 17:13:12 +09:00
Yuya Nishihara
92d100a5b6 commands: move debugcommands and debugcomplete back to commands module
These commands depend heavily on the commands table, so it doesn't make
much sense to isolate them to debugcommands.py. This helps eliminating
the future import cycle.
2017-05-14 16:42:16 +09:00
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
Martin von Zweigbergk
09d53c160b merge with stable 2017-05-12 11:20:25 -07:00
Mads Kiilerich
d682210796 graft: fix graft across merges of duplicates of grafted changes
Graft used findmissingrevs to find the candidates for graft duplicates in the
destination. That function operates with the constraint:

  1. N is an ancestor of some node in 'heads'
  2. N is not an ancestor of any node in 'common'

For our purpose, we do however have to work correctly in cases where the graft
set has multiple roots or where merges between graft ranges are skipped. The
only changesets we can be sure doesn't have ancestors that are grafts of any
changeset in the graftset, are the ones that are common ancestors of *all*
changesets in the graftset. We thus need:

  2. N is not an ancestor of all nodes in 'common'

This change will graft more correctly, but it will also in some cases make
graft slower by making it search through a bigger and unnecessary large sets of
changes to find duplicates. In the general case of grafting individual or
linear sets, we do the same amount of work as before.
2017-05-11 17:18:40 +02:00
Pierre-Yves David
6777304ca7 bundle: introduce an higher level function to write bundle on disk
The current function ('writebundle') is focussing on getting an existing
changegroup to disk. It is no easy ways to includes more part in the generated
bundle2. So we introduce a slightly higher level function that is fed the
'outgoing' object (that defines the bundled spec) and the bundlespec parameters
(to control the changegroup generation and inclusion of other parts).

This is creating the third logic dedicated to create a consistent bundle2 (the
other 2 are the push code and the getbundle code). We should probably reconcile
them at some points but they all takes different types of input. So we need to
introduce an intermediate "object" that each different input could be converted
to. Such unified "bundle2 specification" could be fed to some unified code.

We start by having the `hg bundle` related code on its own to helps defines its
specific needs first. Once the common and specific parts of each logic will be
known we can start unification.
2017-05-05 17:09:47 +02:00
Pierre-Yves David
e9ce49e179 bundle: handle compression earlier
We can also handle that part before starting any generation.
2017-05-04 21:47:03 +02:00
Pierre-Yves David
f76028d798 bundle: check changegroup version earlier
We can check if we know how to bundle this changegroup version before actually
starting to generate the changegroup.
2017-05-04 21:46:02 +02:00
Pierre-Yves David
f734e61f99 bundle: check lack of revs to bundle before generating the changegroup
We already have the information so we can check it earlier.
2017-05-04 21:44:36 +02:00
Matt DeVore
2eace305ec log: document the characters ---graph uses to draw
The meaning of : vs | was undocumented and non-obvious.
2017-04-18 14:51:32 -07:00
Matt Harbison
6d898e296f serve: add support for Mercurial subrepositories
I've been using `hg serve --web-conf ...` with a simple '/=projects/**' [paths]
configuration for awhile without issue.  Let's ditch the need for the manual
configuration in this case, and limit the repos served to the actual subrepos.

This doesn't attempt to handle the case where a new subrepo appears while the
server is running.  That could probably be handled with a hook if somebody wants
it.  But it's such a rare case, it probably doesn't matter for the temporary
serves.

The main repo is served at '/', just like a repository without subrepos.  I'm
not sure why the duplicate 'adding ...' lines appear on Linux.  They don't
appear on Windows (see 3f4ff1bdf101), so they are optional.

Subrepositories that are configured with '../path' or absolute paths are not
cloneable from the server.  (They aren't cloneable locally either, unless they
also exist at their configured source, perhaps via the share extension.)  They
are still served, so that they can be browsed, or cloned individually.  If we
care about that cloning someday, we can probably just add the extra entries to
the webconf dictionary.  Even if the entries use '../' to escape the root, only
the related subrepositories would end up in the dictionary.
2017-04-15 18:05:40 -04:00
Pulkit Goyal
c3219cc9ed py3: convert kwargs' keys to str before passing in cmdutil.getcommiteditor 2017-05-05 04:41:45 +05:30
Pierre-Yves David
e6d7dd827e bundle: factor the 'getchangegroup' out
The call in the two branches is identical, so we can just issue it outside of
the conditional.
2017-05-04 12:48:45 +02:00
Pierre-Yves David
ce3d8fe617 bundle: avoid reset of the 'outgoing' variable
We have a cleaner way to achieve the same effect. Not resetting the variable
will help us to simplify the code.
2017-05-04 12:47:27 +02:00
Pierre-Yves David
8247e24b4d commands: directly 'getchangegroup'
It is identical to 'getlocalchangegroup' with a shorter name.
2017-05-04 12:41:17 +02:00
Martin von Zweigbergk
feebdd58e5 changegroup: delete unused 'bundlecaps' argument (API) 2017-05-02 23:47:10 -07:00
Pulkit Goyal
5e026b2f2b py3: handle opts correctly for hg add
opts in add command were passed again to cmdutil.add() as kwargs so we need
to convert them again to str. Intstead we convert them to bytes when passing
scmutil.match(). Opts handling is also corrected for all the functions which
are called from cmdutil.add().
2017-04-25 01:52:30 +05:30
Pulkit Goyal
524f812ff5 py3: handle opts correctly for rollback
dryrun and force are just check for None, the value is not used. So its better
to leave opts as unicodes as that wont harm us.
2017-04-24 04:32:04 +05:30
Pulkit Goyal
6458308e66 py3: handle opts correctly for unbundle
There is just a check whether the value is None or not. So even having
optupdate as unicodes won't harm us.
2017-04-21 15:04:32 +05:30
Pulkit Goyal
bcae1e9ab7 py3: make sure opts are passed and used correctly in help command
opts are converted back to bytes in help.help_() where they are used.
Before that it's ensured that we have a bytes value for keep variable.
2017-04-28 00:49:30 +05:30
Pulkit Goyal
13bba2b158 py3: handle opts uniformly in commands.py
Since keyword arguments can't be bytes on Python 3, we converted then to
unicodes before passing into different command functions. We need to adopt a
certain pattern to convert opts back to bytes. Following are some of the
functions which are called from inside these command functions and should
always be feeded bytes to follow the right behaviour.

ui.fomattter()
scmutil.match()
patch.diffallopts()
hg.peer()
cmdutil.{show_changeset|copy|graphrevs|checkunsupportedflag}
server.{createservice|runservice}

There are few commands which are left out where opts is again passed to a
function as keyword arguments or converting opts back to bytes is kind of
not necessary. Those are cat, revert, help, unbundle and rollback. Following
patches will deal with them. This patch apart from these five commands,
convert opts back to bytes for rest of the commands.

This fixes a lot of things which are hidden like --git works now. Similarly
more flags of commands which run on Python 3 currently get fixed.
2017-05-03 15:25:06 +05:30
Jun Wu
04c3104f68 annotate: use fctx.isbinary 2017-05-03 18:03:38 -07:00
Martin von Zweigbergk
971305ce1d bisect: allow resetting with unfinished graft/rebase/etc
"hg bisect --reset" just deletes the state file (it doesn't move back
to the starting point like rebase does); it can not conflict with an
ongoing rebase etc.

checkunfinished() has this documentation:

  It's probably good to check this right before bailifchanged().

So that's where I moved it.
2017-05-03 09:09:44 -07:00
Ryan McElroy
ce07523994 pull: abort pull --update if config requires destination (issue5528) 2017-04-07 06:31:50 -07:00
Jun Wu
aa5d108c15 bundle: allow bundle command to use changegroup3 in tests
Since bundle2 writes changegroup version, we can just reuse the bundle2
format for changegroup3.

This won't enable the bundle command to write changegroup3 in the wild,
since exchange.parsebundlespec only returns changegroup2. It unlocks tests
to override exchange.parsebundlespec and get "hg bundle" write changegroup3.
2017-04-06 17:01:58 -07:00
Pulkit Goyal
40a840896d py3: use pycompat.byteskwargs() to convert opts to bytes
We have converted opts to unicodes before passing them.
2017-04-07 13:45:33 +05:30
Alexander Fomin
b6338c907a diff: add --binary option for git mode diffs
This patch adds --binary option to `hg diff` and `hg export` to allow more
control about when binary diffs are displayed in Git mode as well as some
tests to verify it behaves correctly (issue5510).
2017-04-05 15:31:08 -07:00
Gregory Szorc
04c3125727 commands: update help for "unbundle"
Similar to the recent change to "bundle," this command no longer
just deals with "changegroup" data.
2017-04-01 13:43:52 -07:00
Gregory Szorc
5c890f5f16 commands: update help for "bundle"
We now have a dedicated help topic to describe bundle specification
strings. Let's update `hg bundle`'s documentation to reflect its
existence.

While I was hear, I also tweaked some wording which I felt was out
of date and needed tweaking. Specifically, `hg bundle` no longer
just deals with "changegroup" data: it can also generate files
that have non-changegroup data.
2017-04-01 13:43:43 -07:00
Denis Laxalde
f25fa2b8d5 summary: display obsolete state of parents
Extend the "parent: " lines in summary to display "(obsolete)" when the parent
is obsolete.
2017-03-25 11:30:08 +01:00
Jun Wu
28aef1acdc debugconfig: list environment variables in debug output
Since we print "read config from" for config files, printing environment
variables will make it more consistent.
2017-03-26 21:40:22 -07:00
Jun Wu
cc0447168c rcutil: let environ override system configs (BC)
This is BC because system configs won't be able to override $EDITOR, $PAGER.
The new behavior is arguably more rational.
2017-03-26 21:33:37 -07:00
Jun Wu
d4692f9619 rcutil: let rccomponents return different types of configs (API)
The next patches will convert environ to raw config items, and insert the
config items between systemrcpath and userrcpath. This patch teaches
rccomponents to return the type information so the caller could distinguish
between "path" and raw config "items".
2017-03-26 21:04:29 -07:00
Jun Wu
d63b24bd71 rcutil: rename rcpath to rccomponents (API) 2017-03-26 20:48:00 -07:00
Jun Wu
582704c32f rcutil: move scmutil.*rcpath to rcutil (API)
As discussed at [1], the logic around "actual config"s seem to be
non-trivial enough that it's worth a new module.

This patch creates the module and move "scmutil.*rcpath" functions there as
the first step. More methods will be moved to the module in the future.

The module is different from config.py because the latter only cares about
data structure and parsing, and does not care about special case, or system
config paths, or environment variables.

[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095503.html
2017-03-26 20:18:42 -07:00
Pierre-Yves David
b55b067aa6 tags: use the 'tag' function from the 'tags' module in the 'tag' command
There is No need to go through the 'repo' object method anymore.
2017-03-27 16:00:34 +02:00
Martin von Zweigbergk
68e5878038 status: support commands.status.relative config
When the config is set to true, status output becomes relative to the
working directory. This has bugged me since I started using hg and it
turns it is sillily simple to support it (unless I missed something,
of course).

We could also add a --relative flag, but I would personally always
want that on, and I haven't heard any use for having it sometimes on,
so this patch only lets you enable it via config.
2017-03-21 17:50:44 -07:00
Martin von Zweigbergk
dc4c37c445 plain: ignore [commands] config
We only have commands.{update,rebase}.requiredest so far. We should
clearly ignore those two if HGPLAIN is in effect, and it seems like we
should ignore any future config that will be added in [commands] since
that is about changing the behavior of commands.

Thanks to Yuya for suggesting to centralize the code in ui.py.

While at it, remove the unnecessary False values passed to
ui.configbool() for the aforementioned config options.
2017-03-21 21:26:52 -07:00
Ryan McElroy
158bdd12b9 update: add flag to require update destination
In some mercurial workflows, the default destination for update does not
always work well and can lead to confusing behavior. With this flag enabled,
every update command will require passing an explicit destination, eliminating
this confusion.
2017-03-14 17:43:18 -07:00
Augie Fackler
471b2bd76a commit: keep opts as byteskwargs as much as possible
This fixes many flag-handling bugs on 'hg commit' in Python 3.
2017-03-19 01:20:08 -04:00
Yuya Nishihara
7e7dd65819 py3: convert log opts to bytes-key dict
Now simple log command works.
2017-03-14 18:23:59 +09:00
Yuya Nishihara
2b0fe29f27 graphlog: pass function arguments without expansion
It's annoying on Python 3 because keys must be unicode type. Let's stop using
**opts expansion when not necessary.
2017-03-14 18:16:13 +09:00
Rishabh Madan
ea88450bc5 py3: change explicit conversion of config value from str to pycompat.bytestr 2017-03-17 19:12:22 +05:30
Pulkit Goyal
73e25e061d py3: make sure using bytes status char rather than ascii values
'MAR!?IC' is converted to their ascii values when slicing through it. This
patch uses pycompat.iterbytestr() to get bytes value.
2017-03-16 09:13:13 +05:30
Jun Wu
a1b35a50eb commit: get rid of ui.backupconfig 2017-03-16 14:15:20 -07:00
Pulkit Goyal
fcc99d385f py3: convert opts back to bytes for status 2017-03-16 10:10:00 +05:30
Martin von Zweigbergk
b7d134a4b3 heads: enable pager 2017-03-13 11:19:24 -07:00
Martin von Zweigbergk
d6f2ec5990 branches: enable pager 2017-03-13 11:03:59 -07:00
Augie Fackler
f010a9d8ef files: use native string type to load rev opt from dict 2017-03-12 00:51:00 -05:00
Augie Fackler
b9f0d10d43 summary: don't explicitly str() something we're about to %s
str() is wrong on Python 3 here, and %s implicitly calls str() anyway,
so this was just extra dancing for no reason.
2017-03-11 20:58:26 -05:00
Pierre-Yves David
d47e9585d6 commands: directly use repo.vfs.join
The 'repo.join' method is about to be deprecated.
2017-03-08 16:53:17 -08:00
Mads Kiilerich
975c19c195 vfs: use repo.vfs.unlinkpath 2017-03-11 11:02:25 -08:00
Simon Farnsworth
d6cdf14b5e config: set blockedtag when invoking configuration edit 2017-03-06 03:27:24 -08:00
Simon Farnsworth
63ca96dec0 bisect: set a blockedtag when running the check command
So that the hg bisect data clearly shows the bisect command separately to the
main data set.
2017-03-06 03:26:30 -08:00
Yuya Nishihara
7ca440fb7f branches: populate all template keywords in formatter
This is a usage example of fm.context().
2017-02-25 17:08:42 +09:00
Martin von Zweigbergk
5b3eb48725 update: accept --merge to allow merging across topo branches (issue5125) 2017-02-13 12:58:37 -08:00
Pierre-Yves David
a29094b506 color: update main documentation
Now that the feature no longer lives in the extension, we document it in the
help of the core config. This include the new 'ui.color' option introduced in
the previous changesets.

As a result the color extensions can now be deprecated.

This is a documentation patch only; color is still disabled by default.
2017-02-21 20:04:55 +01:00
Pierre-Yves David
b29eb57306 color: add a 'ui.color' option to control color behavior
This new option control whether or not color will be used. It mirror the behavior
of '--color'. I usually avoid adding new option to '[ui]' as the section is
already filled with many option. However, I feel like 'color' is central enough
to deserves a spot in this '[ui]' section.

For now the option is not documented so it is still marked as experimental. Once
it get documented and official, we should be able to deprecate the color
extensions.

There is more cleanup to do before that documentation is written, but we need
this option early to made them. Having that option will allow for more cleanup
of the initialisation process and proper separation between color
configuration.
2017-02-25 19:44:23 +01:00
Pierre-Yves David
e5d5db7cf5 color: add the definition of '--color' in core
If we want to be able to move the initialisation in core, we need core to be
aware of that '--color' flag at all time. So we now have the definition in core. That flag
is currently unprocessed without the extensions (will be fixed soon). In
addition the default value for this flag in core is 'never'. Enabling the
extensions change that default value to 'auto'.
2017-02-21 18:09:21 +01:00
Jun Wu
6faada5b11 serve: mark --stdio and --cmdserver as "(ADVANCED)" flags
This will hide them from the default --help output.
2017-02-22 18:26:12 -08:00
Augie Fackler
01f8d0793b help: move rst formatting of help documents into help.py
This slight refactor will help me improve the 'unknown command'
experience in our new glorious pager future.
2017-02-21 14:17:31 -05:00
Augie Fackler
dfa0dfc344 outgoing: avoid running pager until we're actually showing changes
Consistent with the new behavior of incoming in the previous patch.
2017-02-21 11:06:02 -05:00
Augie Fackler
4aaf8fb8de incoming: delay pager activation until right before printing changes
This prevents authentication and other brief status messages from
being paged.
2017-02-21 10:53:13 -05:00
Augie Fackler
2370f84a66 version: enable pager if --verbose is specified
`hg version` output is very short without --verbose, but with
--verbose it tends to scroll off the user's screen.
2017-02-06 23:08:49 -05:00
Augie Fackler
fde1794204 tags: enable pager 2017-02-06 23:07:16 -05:00
Augie Fackler
c5a4c5d201 summary: enable pager 2017-02-06 23:06:59 -05:00
Augie Fackler
2d27058975 status: enable pager 2017-02-06 23:06:32 -05:00
Augie Fackler
209ab0d249 resolve: enable pager 2017-02-06 23:06:10 -05:00
Augie Fackler
985790e307 paths: enable pager 2017-02-06 23:06:01 -05:00
Augie Fackler
7b68f2b1da outgoing: enable pager
The structure here is similar to incoming, and requires similar treatment.
2017-02-06 23:04:44 -05:00
Augie Fackler
9d43fd6ddc manifest: enable pager 2017-02-06 23:04:26 -05:00
Augie Fackler
01454df49d locate: enable pager 2017-02-06 23:04:10 -05:00
Augie Fackler
9db50905cf incoming: enable pager
The design of incoming means we have to activate the pager in several
places, depending on which codepath gets chosen.
2017-02-06 23:03:48 -05:00
Augie Fackler
046fd9f790 help: enable pager 2017-02-06 23:09:21 -05:00
Augie Fackler
d2ebbe816e grep: enable pager 2017-02-06 23:09:15 -05:00
Augie Fackler
8163007f6e files: enable pager 2017-02-06 23:02:48 -05:00
Augie Fackler
bc44ae0cf0 config: activate pager if not starting an editor
This demonstrates the power of the non-attend-based pager API.
2017-02-06 23:01:42 -05:00
Augie Fackler
31938f0650 log: migrate to modern pager API 2017-02-06 22:59:25 -05:00
Augie Fackler
776882e795 export: migrate to modern pager API 2017-02-06 22:58:54 -05:00
Augie Fackler
a057b6046c diff: migrate to modern pager API 2017-02-06 22:58:26 -05:00
Augie Fackler
4452f8a320 cat: migrate to modern pager API 2017-02-06 22:57:52 -05:00
Augie Fackler
7488e11fe2 annotate: start pager after we're sure we wont abort
This avoids needlessly putting a short error message into the pager.
2017-02-19 15:09:41 -05:00
Yuya Nishihara
b2229f5117 revset: split language services to revsetlang module (API)
New revsetlang module hosts parser, tokenizer, and miscellaneous functions
working on parsed tree. It does not include functions for evaluation such as
getset() and match().

  2288 mercurial/revset.py
   684 mercurial/revsetlang.py
  2972 total

get*() functions are aliased since they are common in revset.py.
2017-02-19 18:19:33 +09:00
Yuya Nishihara
f5002345c5 help: add pointer how to narrow list of resolved/unresolved files (issue5469) 2017-02-18 18:00:01 +09:00
Augie Fackler
c7eae9f3c3 annotate: migrate to modern pager API 2017-02-06 22:52:47 -05:00
Augie Fackler
3967c4ed9b pager: move more behavior into core
This moves the global flag and the --pager=yes logic into core. Only
functionality change is that users now always get a --pager flag and
can enable the pager via the flag without the extension active.

Moving the flag into core exposes a defect in the ro localization,
which will have to be corrected later.
2017-02-15 17:47:57 -05:00
Martin von Zweigbergk
a305f5d310 update: clarify that -C and -c are mutually exclusive
This makes it clear in both the synopsis and in the verbose output
that -C and -c are mutually exclusive. It also restructures the
verbose output a little so it's better prepared for a third option
(--merge).

This patch also reorders the options to match the flag table.
2017-02-13 15:04:46 -08:00
Martin von Zweigbergk
645fe27a5b update: move check for dirty wdir into hg.updatetotally()
The function has a "check" parameter that's currently unused, and it
makes sense to me to have it honor it. That way other callers than
commands.update() could set it if they needed.
2017-02-13 11:58:02 -08:00
Pierre-Yves David
8a9827fe5f debugcommands: move 'debugwireargs' in the new module 2017-02-02 10:07:53 +01:00
Pierre-Yves David
1bbc8f9ef7 debugcommands: move 'debugwalk' in the new module 2017-02-02 10:07:28 +01:00
Pierre-Yves David
68e72c9e9f debugcommands: move 'debugtemplate' in the new module 2017-02-02 10:06:01 +01:00
Pierre-Yves David
5413311102 debugcommands: move 'debugsuccessorssets' in the new module 2017-02-02 10:05:22 +01:00
Pierre-Yves David
eb978b57f3 debugcommands: move 'debugsub' in the new module 2017-02-02 10:04:55 +01:00
Pierre-Yves David
389ca05060 debugcommands: move 'debugstate' in the new module 2017-02-02 10:04:34 +01:00
Pierre-Yves David
1aad61ce3a debugcommands: move 'debugsetparents' in the new module 2017-02-02 10:04:02 +01:00
Pierre-Yves David
05add5088d debugcommands: move 'debugrevspec' in the new module 2017-02-02 10:03:31 +01:00
Pierre-Yves David
45e4019b63 debugcommands: move 'debugrevlog' in the new module 2017-02-02 10:02:40 +01:00
Pierre-Yves David
83109d4530 debugcommands: move 'debugrename' in the new module 2017-02-02 10:01:54 +01:00
Pierre-Yves David
1e95d66c06 debugcommands: move 'debugrebuildfncache' in the new module 2017-02-02 10:01:00 +01:00
Pierre-Yves David
74184e0c1e debugcommands: move 'debugrebuilddirstate' in the new module 2017-02-02 10:00:26 +01:00
Pierre-Yves David
4ce21eab61 debugcommands: move 'debugpvec' in the new module 2017-02-02 09:59:47 +01:00
Pierre-Yves David
76f079037b debugcommands: move 'debugpushkey' in the new module 2017-02-01 17:48:30 +01:00
Pierre-Yves David
b9a9f5a1dd debugcommands: move 'debugpathcomplete' in the new module 2017-02-01 17:47:35 +01:00
Pierre-Yves David
28c82b2cb9 debugcommands: move 'debugobsolete' in the new module 2017-02-01 17:46:21 +01:00
Pierre-Yves David
9303dddfba debugcommands: move 'debuglocks' in the new module 2017-02-01 17:42:49 +01:00
Pierre-Yves David
28987a9a4d debugcommands: move 'debugnamecomplete' in the new module 2017-02-01 17:41:12 +01:00
Pierre-Yves David
fa71d3be28 debugcommands: move 'debugmergestate' in the new module 2017-02-01 17:40:20 +01:00
Pierre-Yves David
33363270fe debugcommands: move 'debuglabelcomplete' in the new module 2017-02-01 17:39:31 +01:00
Pierre-Yves David
7530639d94 debugcommands: move 'debugknown' in the new module 2017-02-01 17:33:46 +01:00
Pierre-Yves David
efc08d5147 debugcommands: extract debuginstall in the debugcommands module 2017-02-01 17:31:05 +01:00
Martin von Zweigbergk
2b641873b5 merge with stable 2017-02-13 09:44:16 -08:00
FUJIWARA Katsunori
2afd920706 misc: update year in copyright lines
This patch also makes some expected output lines in tests glob-ed for
persistence of them.

BTW, files below aren't yet changed in 2017, but this patch also
updates copyright of them, because:

    - mercurial/help/hg.1.txt

      almost all of "man hg" output comes from online help of hg
      command, and is already changed in 2017

    - mercurial/help/hgignore.5.txt
    - mercurial/help/hgrc.5

      "copyright 2005-201X Matt Mackall" in them mentions about
      copyright of Mercurial itself
2017-02-12 02:23:33 +09:00
Martin von Zweigbergk
98ebae390c import: mention "stdin" (abbreviated) and add example
I actually didn't even think it was possible because I searched the
help text for "stdin", and didn't even think of searching for
"standard input". Let's mention the abbreviated form too to help
others like me. (When importing from stdin, we actually print a
message saying "applying patch from stdin".)

This patch also adds an example showing how to import from stdin.
2017-02-10 15:26:03 -08:00
Pulkit Goyal
d8a99dbaf7 py3: convert os.__file__ to bytes
os.__file__ returns unicode path on Python 3. We need to have bytespath. This
patch uses pycompat.fsencode() to encode unicode path to bytes path.
2017-02-07 22:47:24 +05:30
Pulkit Goyal
f38d10e539 help: update help for hg update which was misleading (issue5427) 2017-01-18 03:44:19 +05:30
Martin von Zweigbergk
9e63f2d21c bisect: refer directly to bisect() revset predicate in help
We have specific syntax for displaying the help text for a particular
revset predicate, so let's refer directly to the bisect() revset in
the verbose bisect help. It seems likely that the user doesn't care
about other revsets at that point, so they will probably not miss the
text about the other revset predicates.
2017-01-12 12:05:23 -08:00
Martin von Zweigbergk
029203f29d help: remove now-redundant pointer to revsets help
"hg help revisions" and "hg help revsets" now point to the same text,
so drop the revsets reference.
2017-01-12 11:52:05 -08:00
Gregory Szorc
a95fb0b61b wireproto: advertise supported media types and compression formats
This commit introduces support for advertising a server's support for
media types and compression formats in accordance with the spec defined
in internals.wireproto.

The bulk of the new code is a helper function in wireproto.py to
obtain a prioritized list of compression engines available to the
wire protocol. While not utilized yet, we implement support
for obtaining the list of compression engines advertised by the
client.

The upcoming HTTP protocol enhancements are a bit lower-level than
existing tests (most existing tests are command centric). So,
this commit establishes a new test file that will be appropriate
for holding tests around the functionality of the HTTP protocol
itself.

Rounding out this change, `hg debuginstall` now prints compression
engines available to the server.
2016-12-24 15:21:46 -07:00
Gregory Szorc
45174d8965 commands: config option to control bundle compression level
Currently, bundle compression uses the default compression level
for the active compression engine. The default compression level
is tuned as a compromise between speed and size.

Some scenarios may call for a different compression level. For
example, with clone bundles, bundles are generated once and used
several times. Since the cost to generate is paid infrequently,
server operators may wish to trade extra CPU time for better
compression ratios.

This patch introduces an experimental and undocumented config
option to control the bundle compression level. As the inline
comment says, this approach is a bit hacky. I'd prefer for
the compression level to be encoded in the bundle spec. e.g.
"zstd-v2;complevel=15." However, given that the 4.1 freeze is
imminent, I'm not comfortable implementing this user-facing
change without much time to test and consider the implications.
So, we're going with the quick and dirty solution for now.

Having this option in the 4.1 release will enable Mozilla to
easily produce and test zlib and zstd bundles with non-default
compression levels in production. This will help drive future
development of the feature and zstd integration with Mercurial.
2017-01-10 11:20:32 -08:00
Denis Laxalde
6dab59dff8 summary: use ui.label and join to write evolution troubles
Follow-up on da7b2bf5ad52 to avoid a convoluted loop.
2017-01-07 12:24:15 +01:00
Denis Laxalde
5e3ca8d1ab summary: add evolution "troubles" information to summary output
Extend the "parent: " lines in summary with the list of evolution "troubles"
in parentheses, when the parent is troubled.
2017-01-06 14:35:22 +01:00
Denis Laxalde
8ebbb5679b summary: use the same labels as log command in "parent: " line
Re-use the cmdutil._changesetlabels function introduced in c400c86d547f to
have consistent labels between the "changeset: " line in log command and the
"parent: " line in summary.
2017-01-06 14:34:34 +01:00
Yuya Nishihara
2e50d5587f smartset: move set classes and related functions from revset module (API)
These classes are pretty large and independent from revset computation.

  2961 mercurial/revset.py
   973 mercurial/smartset.py
  3934 total

revset.prettyformatset() is renamed to smartset.prettyformat(). Smartset
classes are aliased since they are quite common in revset.py.
2016-10-16 17:28:51 +09:00
Yuya Nishihara
da936af562 help: show section that couldn't be found
For better error indication.
2017-02-05 18:57:19 +09:00
Pulkit Goyal
d310fba3dd py3: have a bytes version of shlex.split()
shlex.split() only accepts unicodes on Python 3. After this patch we will be
using pycompat.shlexsplit(). This patch also replaces existing occurences of
shlex.split with pycompat.shlexsplit.
2016-12-25 03:06:55 +05:30
Pulkit Goyal
007bf9e678 py3: replace sys.executable with pycompat.sysexecutable
sys.executable returns unicodes on Python 3. This patch replaces occurences of
sys.executable with pycompat.sysexecutable.
2016-12-20 00:20:07 +05:30
Pulkit Goyal
8edc9540ee py3: replace sys.platform with pycompat.sysplatform (part 1 of 2)
sys.platform returns unicode on python 3 world. Our code base has most of the
things bytes because of the transformer. So we have a bytes version of this as
pycompat.sysplatform. This series of 2 patches replaces occurences of
sys.platform with pycompat.sysplatform.
2016-12-19 02:15:24 +05:30
Yuya Nishihara
26dd8d740c ui: do not translate empty configsource() to 'none' (API)
It should be processed when displaying data, so we can get "source": "" in
JSON output.
2016-10-23 17:47:00 +09:00
Pulkit Goyal
f18da7ce65 py3: replace os.sep with pycompat.ossep (part 1 of 4)
os.sep returns unicodes on Python 3. We have pycompat.ossep which returns
bytes. This patch is a part of 4 patch series which will replace all the
occurrences of os.sep to pycompat.ossep
2016-12-17 19:56:30 +05:30
Pulkit Goyal
28d96dbde6 py3: use %d instead of %s for integers
Python 3 returns an error if we use %s as type specifiers for integers.
2016-12-17 19:36:40 +05:30
Gregory Szorc
275bf7db29 debugcommands: move 'debugdeltachain' in the new module 2016-08-17 21:01:02 -07:00
Gregory Szorc
df02df41b0 debugcommands: move 'debugindex' and 'debugindexdot' in the new module 2016-08-17 21:00:11 -07:00
Gregory Szorc
56f5ef7ff5 debugcommands: move 'debugignore' in the new module 2016-08-17 20:59:13 -07:00
Gregory Szorc
1ec64ddf29 debugcommands: move 'debuggetbundle' in the new module 2016-11-10 09:44:47 -08:00
Gregory Szorc
a47dd1170a debugcommands: move 'debugfsinfo' in the new module 2016-08-17 20:58:16 -07:00
Gregory Szorc
c3736a6fe2 debugcommands: move 'debugfileset' in the new module 2016-08-17 20:57:57 -07:00
Pulkit Goyal
97f340e354 py3: use pycompat.getcwd() instead of os.getcwd()
We have pycompat.getcwd() which returns bytes path on Python 3. This patch
changes most of the occurences of the os.getcwd() with pycompat one.
2016-11-23 00:03:11 +05:30
Gregory Szorc
06abee55d2 debugcommands: move 'debugextensions' to the new module 2016-08-17 20:57:15 -07:00