Commit Graph

11034 Commits

Author SHA1 Message Date
Pierre-Yves David
51dbd8dd60 bundle2: support for bundling parameter value
Parameter can now have a value. We use a `<name>=<value>` form inspired from
capabilities.

There is still no kind of escaping in the name or value, yet.
2014-03-18 16:05:06 -07:00
Pierre-Yves David
6b98362873 bundle2: clarify stream parameter design in the documentation
Stream level parameter have very restricted use case. Clarify why we chosen a
textual format and point that applicative data goes in applicative parts.
2014-03-20 13:18:34 -07:00
Sean Farley
9b0f10caf6 repoview: add non-global tags to candidate list for blocking hidden changesets
Previously, only bookmarks would be considered for blocking a changeset from
being hidden. Now, we also consider non-global tags. This is helpful if we have
local tags that might be hard to find once they are hidden, or tag that are
added by extensions (e.g. hggit or remotebranches).
2014-03-18 20:10:33 -05:00
Pierre-Yves David
c9ee8e68ae bundle2: support for unbundling simple parameter
the unbundler now understand simple list of parameter.
2014-03-18 15:56:24 -07:00
Pierre-Yves David
d7d49ad3b9 bundle2: support bundling simple parameter
This changeset add bundling capacity for simple parameters, not value or any
special case are handled.
2014-03-19 14:52:03 -07:00
Pierre-Yves David
0a30072db3 bundle2: make sure the unbundler refuse non bundle2 stream
We now make use of the magic string at the beginning of the file.
2014-03-18 16:35:34 -07:00
Pierre-Yves David
111c1061ba bundle2: a very first version of bundle2 unbundler
This changeset introduce an unbundler class to match the bundle2 bundler. It is
currently able to unbundle an empty bundle2 only and will gain more feature at
the same pace than the bundler.

It also comes with its special extension command in test.
2014-03-18 14:28:42 -07:00
Pierre-Yves David
b5e3ef023e bundle2: very first version of a bundle2 bundler
This changeset is the very first of a long series. It create a new bundle2
module and add a simple class that generate and empty bundle2 container.

The module is documented with the current state of the implementation. For
information about the final goal you may want to consult the mercurial wiki
page:

    http://mercurial.selenic.com/wiki/BundleFormat2

The documentation of the module will be updated with later patches adding more and
more feature to the format.

This patches also introduce a test case. This test case build and use its own
small extension that use the new bundle2 module. Since the new format is unable
to do anything right now, we could not use real mercurial code to test it.
Moreover, some advanced feature of the bundle2 spec will not be used by core
mercurial at all. So we need to have them tested.
2014-03-18 14:00:50 -07:00
Yuya Nishihara
c1118648fb clone: abort if default destination has no meaningful name (BC)
If source URL has no path, default destination is resolved as '.'. It is
surprising than useful, and perhaps an unexpected behavior.

This change does not solve issue3880, but can avoid to clone into current
directory by accident.
2014-03-22 00:46:12 +09:00
Yuya Nishihara
b9bc586fe9 clone: add doctest for default destination 2014-03-22 00:46:08 +09:00
Durham Goode
c173245d83 scmutil: fix revrange when multiple revs are specified
revrange was trying to add a list to a revset class, but revset classes only
support adding with other revset classes. So wrap the lists in basesets.
2014-03-20 09:55:44 -07:00
Matt Harbison
aba75e33f4 parsers: fix compiler errors on MSVC 2008
This broke in 945eb8bd8f12.
2014-03-20 00:01:59 -04:00
Matt Mackall
62ec223373 check-code: check for argument passing py2.6ism 2014-03-19 18:04:03 -05:00
Siddharth Agarwal
1c5bc58f8f sshpeer: only print out 'running ssh' messages in debug mode (BC)
Previously, if another command was run with --verbose, and for whatever reason
that invoked sshpeer, we'd get a 'running ssh' message from sshpeer. This extra
line would interfere with that command's output and cause dumb parsers to
break.

For example, hg annotate can be run with --verbose to get full usernames. This,
combined with the third-party remotefilelog extension which can cause ssh
connections to be created, leads to an extra 'running ssh' line that breaks
most parsers.

This patch is (BC) because hg pull --verbose will no longer print out exactly
what ssh command it is running.

No tests are affected by this change.
2014-03-18 13:40:03 -07:00
Mads Kiilerich
5157505e94 merge: mark mergestate as dirty when resolve changes _state
Correctness - no visible difference so far.
2014-02-28 02:26:03 +01:00
Mads Kiilerich
eb672bcfce backout: improve confusing 'cannot backout change on a different branch' abort
These days 'branch' usually refer to a named branch.

Instead, abort with 'cannot backout change that not is an ancestor'.
2014-02-24 22:42:14 +01:00
Mads Kiilerich
2629efac4f config: set a 'source' in most cases where config don't come from file but code
Some extensions set configuration settings that showed up in 'hg showconfig
--debug' with 'none' as source. That was confusing.

Instead, they will now tell which extension they come from.

This change tries to be consistent and specify a source everywhere - also where
it perhaps is less relevant.
2014-03-19 02:45:14 +01:00
Mads Kiilerich
41ac098c3e config: don't set source when no source is specified - don't overwrite with ''
This prevents ui.fixconfig from overwriting the source of paths and it will
thus show up in showconfig --debug.
2014-03-19 02:45:14 +01:00
Mads Kiilerich
160aa99a26 config: give a useful hint of source for the most common command line settings
'hg showconfig --debug' will instead of:
  none: ui.verbose=False
give the better hint:
  --verbose: ui.verbose=False
2014-03-19 02:45:04 +01:00
Mads Kiilerich
55b56c55c8 config: backout 012889e73d40 - 8224e8f455bf removed the only use of overlay 2014-03-19 01:59:15 +01:00
Matt Mackall
2b7a5581ef config: mention edit options and config topic in help 2014-03-18 18:57:19 -05:00
Matt Mackall
55a0f78973 config: add --global and --local flags
These start an editor on the system-wide or repository-level config files.
2014-03-18 18:49:30 -05:00
Matt Mackall
2dfc464098 revrange: pass repo to revset parser
This allows handling of hyphenated symbols for command-line revsets.
2014-03-18 17:56:27 -05:00
Matt Mackall
4436b1c4a4 revset: try to handle hyphenated symbols if lookup callback is available
Formerly an expression like "2.4-rc::" was tokenized as 2.4|-|rc|::.
This allows dashes in symbols iff the whole symbol-like string can be
looked up. Otherwise, it's tokenized as a series of symbols and
operators.

No attempt is made to accept dashed symbols inside larger symbol-like
string, for instance foo-bar or bar-baz inside foo-bar-baz.
2014-03-18 17:54:42 -05:00
Matt Mackall
a9a943eddd revset: pass a lookup function to the tokenizer 2014-03-18 17:19:44 -05:00
Matt Mackall
39f29cd5bc parser: allow passing a lookup function to a tokenizer
This will allow us to dynamically handle hyphenated symbols in revsets.
2014-03-18 17:17:23 -05:00
Pierre-Yves David
ce5ac68042 localrepo: rename capability set to lower case.
This is not C and they are not even constant.
2014-03-14 00:02:05 -07:00
Pierre-Yves David
cae4a1d18a wireproto: move wireproto capabilities computation in a subfunction
It will help people that need to add capabilities (in a more subtle was that
just adding some to the list) in multiple way:

1. This function returns a list, not a string. Making it easier to look at,
   extend or alter the content.

2. The original capabilities function will be store in the dictionary of wire
   protocol command. So extension that wrap this function also need to update
   the dictionary entry.

   Both wrapping and update of the dictionary entry are needed because the
   `hello` wire protocol use the function itself. This is specifically sneaky for
   extension writer as ssh use the `hello` command while http use the
   `capabilities` command.

   With this new `_capabilities` function there is one and only one obvious
   place to wrap when needed.
2014-03-12 14:46:41 -07:00
Pierre-Yves David
342e942953 wireproto: extract capabilities list in outside the wireproto function
Before that it was over complicated to add capabilities from an extension.

This mimic was is done for capabilities in localrepo.
2014-03-11 01:38:02 -07:00
Matt Mackall
ea6ffc9a80 merge with stable 2014-03-18 14:25:28 -05:00
Jordi Gutiérrez Hermoso
19098ea63d commit: propagate --secret option to subrepos (issue4182)
Before this patch, `hg commit --secret` was not getting propagated
correctly, and subrepos were not getting the commit in the secret
phase. The problem is that subrepos get their ui from the base repo's
baseui object and ignore the ui object passed on to them. This sets
and restores both ui objects with the appropriate option.
2014-03-17 14:57:13 -04:00
FUJIWARA Katsunori
89fcbff9fc amend: save commit message into ".hg/last-message.txt"
Before this patch, commit message (may be manually edited) for "commit
--amend" is never saved into ".hg/last-message.txt", because it uses
"localrepository.commitctx()" instead of "localrepository.commit()":
saving into ".hg/last-message.txt" is executed only in the latter.

This patch saves commit message for "commit --amend" into
".hg/last-message.txt" just after user editing.

This is the simplest implementation to fix on stable. Editing and
saving commit message for memctx should be centralized into the
framework like "localrepository.commit()" with "editor" argument or so
in the future.
2014-03-19 01:07:41 +09:00
FUJIWARA Katsunori
3acb83dcfb tag: save manually edited commit message into ".hg/last-message.txt"
Before this patch, manually edited commit message for "hg tag -e"
isn't saved into ".hg/last-message.txt" until it is saved by
"localrepository.savecommitmessage()" in "localrepository.commit()".

This may lose such commit message, if unexpected exception is raised.

This patch saves manually edited commit message for "hg tag -e" into
".hg/last-message.txt" just after user editing. This patch doesn't
save the message specified by -m option (-l is not supported for "hg
tag") as same as other commands.

This is the simplest implementation to fix on stable. Editing and
saving commit message should be centralized into the framework of
"localrepository.commit()" with "editor" argument in the future.
2014-03-19 01:07:41 +09:00
FUJIWARA Katsunori
51bca8f3b4 localrepo: save manually edited commit message as soon as possible
Before this patch, "localrepository.commit()" invokes specified
"editor" to edit commit message manually, and saves it after checking
sub-repositories.

This may lose manually edited commit message, if unexpected exception
is raised while checking (or commiting recursively) sub-repositories.

This patch saves manually edited commit message as soon as possible.
2014-03-19 01:07:41 +09:00
Lucas Moscovicz
283e1d99ab graphmod: changed code in dagwalker to use lazy implementations
Used lazy methods when possible.
2014-03-14 08:46:46 -07:00
Lucas Moscovicz
441a4355fa webcommands: changed code to use lazy classes when calling dagwalker
This needs to be changed to use a baseset since dagwalker now expects to
receive a smartset. This is basically wrapping revs into a baseset to be
compatible with smartset implementations.
2014-03-14 08:47:57 -07:00
Lucas Moscovicz
0d53c6ae3b cmdutil: changed max method for lazy call
Used the lazy max call instead of the python max implementation to be able to
use lazysets for graphlog.
2014-03-14 13:27:12 -07:00
Lucas Moscovicz
dafb80fa39 getgraphlogrevs: return an empty baseset instead of a empty list
We aims at returning smartset only so that function higher in the stack can use
smartset feature.
2014-03-14 13:26:40 -07:00
Pierre-Yves David
a0ce769bb9 getgraphlogrevs: do not convert smartset to baseset
We are now sure that revs is a smartset. We remove the baseset call that would
defeat any lazyness.
2014-03-14 16:26:50 -07:00
Lucas Moscovicz
a96218c725 cmdutil: changed revset for spanset
Instead of using baseset(repo.changelog) changed it for spanset(repo) which is
much faster.
2014-03-14 08:44:52 -07:00
Lucas Moscovicz
3972cf7390 cmdutil: changed code in _makegraphlogrevset not to use getitem
__getitem__ is a method that is not implemented lazily on many of the new
classes and it can be easily replaced with a structure that takes advantage of
the new lazy implementations instead.
2014-03-14 11:35:17 -07:00
Lucas Moscovicz
9dd89e3285 cmdutil: changed code in getgraphlogrevs not to use getitem
__getitem__ is a method that is not implemented lazily on many of the new
classes and it can be easily replaced with a structure that takes advantage of
the new lazy implementations instead.
2014-03-14 08:43:52 -07:00
FUJIWARA Katsunori
70f9f39f84 commit: create new amend changeset as secret correctly for "--secret" option
Before this patch, "hg commit --amend --secret" doesn't create new
amend changeset as secret, even though the internal function
"commitfunc()" passed to "cmdutil.amend()" make "phases.new-commit"
configuration as "secret" temporarily.

"cmdutil.amend()" uses specified "commitfunc" only for temporary amend
commit, and creates the final amend commit changeset by
"localrepository.commitctx()" directly with memctx.

This patch creates new amend changeset as secret correctly for
"--secret" option, by changing "phases.new-commit" configuration
temporarily before "localrepository.commitctx()".
2014-03-13 19:48:41 +09:00
Cristian Zamfir
c85ed151ff hg log: solves bug regarding hg log -r 0:null (issue4039)
'hg log -r 0:null' was showing only one changeset(the '-1' one) instead of the first two changesets.
2014-03-12 10:26:48 +02:00
FUJIWARA Katsunori
d28789bf48 templater: make strings in template expressions be "string-escape"-ed correctly
Changeset 83ff877959a6 (released with 2.8.1) fixed "recursively
evaluate string literals as templates" problem (issue4102) by moving
the location of "string-escape"-ing from "tokenizer()" to
"compiletemplate()".

But some parts in template expressions below are not processed by
"compiletemplate()", and it may cause unexpected result.

  - 'expr' of 'if(expr, then, else)'
  - 'expr's of 'ifeq(expr, expr, then, else)'
  - 'sep' of 'join(list, sep)'
  - 'text' and 'style' of 'rstdoc(text, style)'
  - 'text' and 'chars' of 'strip(text, chars)'
  - 'pat' and 'repl' of 'sub(pat, repl, expr)'

For example, '\n' of "{join(extras, '\n')}" is not "string-escape"-ed
and treated as a literal '\n'. This breaks "Display the contents of
the 'extra' field, one per line" example in "hg help templates".

Just "string-escape"-ing on each parts above may not work correctly,
because inside expression of nested ones already applies
"string-escape" on string literals. For example:

  - "{join(files, '\n')}" doesn't return "string-escape"-ed string, but
  - "{join(files, if(branch, '\n', '\n'))}" does

To fix this problem, this patch does:

  - introduce "rawstring" token and "runrawstring" method to handle
    strings not to be "string-escape"-ed correctly, and

  - make "runstring" method return "string-escape"-ed string, and
    delay "string-escape"-ing until evaluation

This patch invokes "compiletemplate()" with "strtoken=exp[0]" in
"gettemplate()", because "exp[1]" is not yet evaluated. This code path
is tested via mapping ("expr % '{template}'").

In the other hand, this patch invokes it with "strtoken='rawstring'"
in "_evalifliteral()", because "t" is the result of "arg" evaluation
and it should be "string-escape"-ed if "arg" is "string" expression.

This patch doesn't test "string-escape"-ing on 'expr' of 'if(expr,
then, else)', because it doesn't affect the result.
2014-03-10 01:01:43 +09:00
FUJIWARA Katsunori
f3e5f1e6c1 templater: apply "stringify()" on sub expression to get string correctly
Templating syntax allows nested expression to be specified as parts
below, but they are evaluated as a generator and don't work correctly.

  - 'sep' of 'join(list, sep)'
  - 'text' and 'chars' of 'strip(text, chars)'

In the former case, 'sep' returns expected string only for the first
separation, and empty one for the second or later, because the
generator has only one element.

In the latter case, templating is aborted by exception, because the
generator doesn't have 'strip()' method (as 'text') and can't be
passed as the argument to 'str.strip()' (as 'chars').

This patch applies "stringify()" on these sub expression to get string
correctly.
2014-03-10 01:01:43 +09:00
FUJIWARA Katsunori
7a7d1bc22c templater: avoid recursive evaluation of string literals completely
Changeset c84f81c3e120 (released with 2.8.1) fixed "recursively
evaluate string literals as templates" problem (issue4103) by
introducing "_evalifliteral()".

But some parts in template expressions below are still processed by
the combination of "compiletemplate()" and "runtemplate()", and may
cause same problem unexpectedly.

  - 'init' and 'hang' of 'fill(text, width, init, hang)'
  - 'expr' of 'sub(pat, repl, expr)'
  - 'label' of 'label(label, expr)'

This patch processes them by "_evalifliteral()" instead of the
combination of "compiletemplate()" and "runtemplate()" to avoid
recursive evaluation of string literals completely.
2014-03-10 01:01:42 +09:00
Yuya Nishihara
6edf7b4a6a phase: say "Returns 0" instead of "Return 0" like other command help 2014-03-03 15:50:45 +09:00
anuraggoel
2e25e2e790 paper: overlapping of section title on help pages (issue4051)
Now there will be no overlap lines between various section title
on help pages. http://selenic.com/repo/hg/help/config
2014-03-03 23:37:59 +05:30
Mads Kiilerich
6c40916e6d merge: audit the right destination file when merging with dir rename 2014-03-01 18:09:39 +01:00