Commit Graph

11192 Commits

Author SHA1 Message Date
Siddharth Agarwal
2fd618b0ed subrepo: add trailing newlines to warnings 2014-03-20 19:39:05 -07:00
Siddharth Agarwal
ab73247b7b subrepo: convert matched string to integer before comparing Git version
(1, '4') is greater than (1, 5) so the version check never actually worked.
2014-03-20 19:38:17 -07:00
Siddharth Agarwal
4b233ba647 subrepo: only retrieve the first two components of the Git version
This makes the version detection compatible with Git versions like '1.9-rc0'.
We only cared about the first two components of the version anyway.
2014-03-20 19:37:01 -07: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
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
Pierre-Yves David
3eab08d896 resolve: use "other" changeset from merge state (issue4163)
We can use the "other" data from the recorded merge state instead of inferring
what the other could be from working copy parent. This will allow resolve to
fulfil its duty even when the second parent have been dropped.

Most direct benefit is fixing a regression in backout.
2014-02-25 18:45:01 -08:00
Pierre-Yves David
f2a2751552 merge: add "other" file node in the merge state file
This data is mostly redundant with the "other" changeset node (+ other changeset
file path). However, more data never hurt.

The old format do not store it so this require some dancing to add and remove it
on demand.
2014-02-25 18:54:47 -08:00
Pierre-Yves David
49ce770140 merge: infer the "other" changeset when falling back to v1 format
When we have to fallback to the old version of the file, we infer the
"other" from current working directory parent. The same way it is currently done
in the resolve command. This is know to have shortcoming… but we cannot do
better from the data contained in the old file format. This is actually the
motivation to add this new file format.
2014-02-27 14:14:57 -08:00
Pierre-Yves David
15afb2ca0c merge: record the "other" node in merge state
We need to record the merge we were merging with. This solve multiple
bug with resolve when dropping the second parent after a merge. This
happen a lot when doing special merge (overriding the ancestor).
Backout, shelve, rebase, etc. can takes advantage of it.

This changeset just add the information in the merge state. We'll use it in the
resolve process in a later changeset.
2014-02-25 18:42:11 -08:00
Pierre-Yves David
b5e943e8cb merge: introduce new format for the state file
This new format will allow us to address common bugs while doing special merge
(graft, backout, rebase…) and record user choice during conflict resolution.

The format is open so we can add more record for future usage.

This file still store hexified version of node to help human willing to debug
it by hand. The overhead or oversize are not expected be an issue.

The old format is still used. It will be written to disk along side the newer
format. And at parse time we detect if the data from old version of the
mergestate are different from the one in the new version file. If its the same,
both have most likely be written at the same time and you can trust the extra
data from the new file. If it differs, the old file have been written by an
older version of mercurial that did not knew about the new file. In that case we
use the content of the old file.
2014-02-25 18:37:06 -08:00
Pierre-Yves David
01a482bed9 merge: change the merge state serialisation to use a record based logic
The format of the file is unchanged. But we are preparing a new file with a new
format that would be record based. So we change all the read/write logic to
handle a list of record until a very low level. This will allow simple plugging
of the new format in the current code.
2014-02-27 12:59:41 -08:00
Pierre-Yves David
2438827558 merge: move merge state file path into a constant
We are about to change the format. Having the file path in a single place make
it easier to update the filename for the new version.
2014-02-25 17:14:49 -08:00
anuraggoel
d215557c0e coal: hgweb style adds extra blank line in file view (issue4136)
Now hgweb style='coal' adds no extra blank in file view.
2014-02-27 22:56:42 +05:30
Piotr Klecha
0968676adc pull: close peer repo on completion (issue2491) (issue2797)
When pulling changes from a compressed bundle Mercurial first uncompresses it
to a temporary file in .hg directory. This file will not be deleted unless
the bundlerepo (other) is explicitly closed.

This is similar to cleanup that occurs after incoming.
2014-02-25 21:26:25 +01:00
Paul Boddie
202d2d5cf4 hgweb: ensure isdirectory is None for repositories, replacing any True value
Until now, repositories did not provide any value for isdirectory in rows
produced for the index output, and thus isdirectory was generally evaluated as
None for each index entry representing a repository.

However, directories (visible when viewed with the descend and collapse
settings enabled) did provide a value of True and this value appeared to
persist in subsequent rows processed by the templater, causing isdirectory
tests in templates to produce incorrect results for index entries appearing
after directories.

This patch asserts the None value for repositories, thus erasing any such
persistent True values.
2014-02-27 00:24:06 +01:00
Danek Duvall
7e62057404 pathencode: eliminate signed integer warnings
Compiling mercurial with the Sun Studio compiler gives seven copies of the
following warning on pathencode.c:

    line 533: warning: initializer will be sign-extended: -1

Using explicit unsigned literals silences it.
2014-02-19 13:11:24 -08:00
Yuya Nishihara
6852c0bb11 verify: do not prevent verify repository containing hidden changesets
Since afe2bc876c89, repo.cancopy() cannot be used to check if the repo is
a bundlerepository.

repo.url() should always have "scheme:", so it isn't necessary to parse
by util.url().
2014-02-19 22:19:45 +09:00
Yuya Nishihara
cdb5aade4f hgweb: make sure sys module is loaded prior to reload hack
If sys is still a demandmod, reload(sys) fails with "TypeError: reload()
argument must be module".
2014-02-19 21:16:43 +09:00
Thomas Arendsen Hein
a22586ff6f help: new SHA-1 fingerprint of hg.intevation.org in hostfingerprints example
The certificate was updated in February 2014.
You can verify the certificate by using the Root CA certificate downloadable
from https://ssl.intevation.de/
The intermediate CA is sent by https://hg.intevation.org/
2014-02-13 13:05:09 +01:00
Brodie Rao
fc55ccd1ef hooks: only disable/re-enable demandimport when it's already enabled
This fixes an issue introduced in 818c8992811a where, when disabling
demandimport while running hooks, it's inadvertently re-enabled even when
it was never enabled in the first place.

This doesn't affect normal command line usage of Mercurial; it only matters
when Mercurial is run with demandimport intentionally disabled.
2014-02-10 14:51:06 -08:00
Mads Kiilerich
4aef593d5a merge: don't overwrite file untracked after remove, abort with 'untracked files'
Merge could overwrite untracked files and cause data loss.

Instead we now handle the 'local side removed file and has untracked file
instead' case as the 'other side added file that local has untracked' case:

  FILE: untracked file exists
  abort: untracked files in working directory differ from files in requested revision

It could perhaps make sense to create .orig files when overwriting, either
instead of aborting or when overwriting anyway because of force ... but for now
we stay consistent with similar cases.
2014-02-10 00:43:54 +01:00
Matt Mackall
fd6c6f9614 hgweb: hack around mimetypes encoding thinko (issue4160)
A correct patch for this has existed in Python's BTS for 3 years
(http://bugs.python.org/issue9291), so waiting for it to be fixed
upstream is probably not a viable strategy. Instead, we add this
horrible hack to workaround the issue in existing copies of Python
2.4-2.7.
2014-02-05 17:23:35 -06:00
Siddharth Agarwal
228773d706 hg: note that islocal only accepts paths pointing to repos
hg.islocal doesn't work for paths pointing to non-repos, such as patch files.
2014-02-03 14:36:20 -08:00
Siddharth Agarwal
cfe3861321 hg.openpath: use url.islocal to tell if the path is local (issue3624)
Previously we used hg.islocal, which doesn't work for paths pointing to
non-repos, such as patch files.
2014-02-03 14:53:44 -08:00
Siddharth Agarwal
22a22b291a util.url: add an 'islocal' method
This returns True if the URL represents a path that can be opened locally,
without needing to go through the entire URL open mechanism.
2014-02-03 14:47:41 -08:00
Pierre-Yves David
b563457396 rebase: do not crash in panic when cwd disapear in the process (issue4121)
Before this patch rebase crashed badly when it happend. (not abort, crash).

Fix courtesy of Matt Mackall.
2014-01-31 15:13:15 -08:00
Angel Ezquerra
83f28887f2 help: improve description of phases.checksubrepos setting
The existing description was a bit hard to understand.
2014-01-29 15:16:36 +01:00
Pierre-Yves David
6265090dee clone: do not turn hidden changeset public on publishing clone (issue3935)
Before this changeset local clone of a repo with hidden changeset would include
then in the clone (why not) and turn them public (plain wrong). This happened
because the copy clone publish by dropping the phaseroot file entirely making
everything in the repo public (and therefore immune to obsolescence marker).

This changeset takes the simplest fix, we deny the copy clone in the case of hidden
changeset falling back to pull clone that will exclude them from the clone and
therefore not turning them public.

A smarter version of copy clone could be done, but I prefer to go for the
simplest solution first.
2014-01-30 11:52:38 -08:00
Julien Cristau
e78105c48a dispatch: take --hidden from individual commands into account
The command server would otherwise ignore that option, since the repo
object is only created once.
2014-01-27 10:57:20 +01:00
FUJIWARA Katsunori
870ab22a06 doc: fix mistake about matching against directories in "pattern.txt"
This fixes mistake of documentation about matching against directories
in "pattern.txt" introduced by b99923dc748f.

".hgignore" treats specified "glob:" pattern as same as one specified
for "-X" option: it can match against directories, too.

For reference, extra regexp string appended to specified pattern for
each types are listed below: see also "match.match()" and
"match._regex()" for detail.

  ============= ========== ===============
  type          cmdline    -I/-X
  ============= ========== ===============
  glob/relglob  '$'        '(?:/|$)'
  path/relpath  '(?:/|$)'  '(?:/|$)'
  re/relre      (none)     (none)
  ============= ========== ===============

Appending '$' means that the specified pattern should match against
only files.
2014-01-30 15:03:36 +09:00
FUJIWARA Katsunori
0b98e91e90 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
Before this patch, shell alias may be executed by abbreviated command
name unexpectedly, even if abbreviated command name matches also
against the command provided by extension.

For example, "rebate" shell alias is executed by "hg reba", even if
rebase extension (= "rebase" command) is enabled. In this case, "hg
reba" should be aborted because of command name ambiguity.

This patch makes "_checkshellalias()" invoke "cmdutil.findcmd()"
always with "strict=True" (default value).

If abbreviated command name matches against only one shell alias even
after loading extensions, such shell alias will be executed via
"_parse()".

This patch doesn't remove "_checkshellalias()" invocation itself,
because it may prevent shell alias from loading extensions uselessly.
2014-01-29 23:47:54 +09:00
Stéphane Klein
f029558dda http: reuse authentication info after the first failed request (issue3567)
[This was applied in df58533adb15 but backed out again in 8127f169caa4 because
of Python 2.4 issues. This edition and test-http.t works with Python 2.4.]

Context: mercurial access to repository server with http access, and this
server is protected by basic auth.

Before patch:

* mercurial try an anonymous access to server, server return 401 response and
  mercurial resend request with login / password information

After patch:

* mercurial try an anonymous access to server, server return
  401 response. For all next requests, mercurial keep in memory this
  information (this server need basic auth information).

This patch reduce the number of http access against mercurial server.

Example, before patch:

10.10.168.170 - - [25/Oct/2013:15:44:51 +0200] "GET /hg/testagt?cmd=capabilities
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:44:52 +0200] "GET /hg/testagt?cmd=capabilities
HTTP/1.1" 200 147 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:00 +0200] "GET /hg/testagt?cmd=capabilities
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:01 +0200] "GET /hg/testagt?cmd=capabilities
HTTP/1.1" 200 147 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:03 +0200] "GET /hg/testagt?cmd=batch
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:04 +0200] "GET /hg/testagt?cmd=batch
HTTP/1.1" 200 42 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:06 +0200] "GET /hg/testagt?cmd=getbundle
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:07 +0200] "GET /hg/testagt?cmd=getbundle
HTTP/1.1" 200 61184 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:09 +0200] "GET /hg/testagt?cmd=listkeys
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:10 +0200] "GET /hg/testagt?cmd=listkeys
HTTP/1.1" 200 15 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:12 +0200] "GET /hg/testagt?cmd=listkeys
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [25/Oct/2013:15:45:12 +0200] "GET /hg/testagt?cmd=listkeys
HTTP/1.1" 200 - "-" "mercurial/proto-1.0"

Example after patch:

10.10.168.170 - - [28/Oct/2013:11:49:14 +0100] "GET /hg/testagt?cmd=capabilities
HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
10.10.168.170 - - [28/Oct/2013:11:49:15 +0100] "GET /hg/testagt?cmd=capabilities
HTTP/1.1" 200 147 "-" "mercurial/proto-1.0"
10.10.168.170 - - [28/Oct/2013:11:49:17 +0100] "GET /hg/testagt?cmd=batch
HTTP/1.1" 200 42 "-" "mercurial/proto-1.0"
10.10.168.170 - - [28/Oct/2013:11:49:19 +0100] "GET /hg/testagt?cmd=getbundle
HTTP/1.1" 200 61184 "-" "mercurial/proto-1.0"
10.10.168.170 - - [28/Oct/2013:11:49:22 +0100] "GET /hg/testagt?cmd=listkeys
HTTP/1.1" 200 15 "-" "mercurial/proto-1.0"
10.10.168.170 - - [28/Oct/2013:11:49:24 +0100] "GET /hg/testagt?cmd=listkeys
HTTP/1.1" 200 - "-" "mercurial/proto-1.0"

In this last example, you can see only one 401 response.
2013-12-20 14:56:05 +01:00
Durham Goode
576523cd84 bundle2: use discard to remove bundle2 cap
caps.remove('bundle2') was throwing an exception if bundle2 wasn't present in
the capabilities. This was causing test-static-http.t to hang. Let's just use
discard, so we don't get an exception.
2014-04-08 13:05:29 -07:00
Pierre-Yves David
bb4442ac82 statichttp: respect localrepo _restrictcapabilities
The static http repository was doing his own filtering of capability ignoring
the filtering done in the local repo main class. This led to static http using
the current draft of bundle2. We now apply both.
2014-04-07 11:45:50 -07:00
Durham Goode
50829c1b45 exchange: pass bundlecaps through to changegroup
The bundlecaps passed to exchange.getbundle were being dropped completely. We
should pass them on through to the changegroup.

This affected the remotefilelog extension, since it relies on those bundlecaps.
2014-04-04 16:41:51 -07:00
Pierre-Yves David
6feac7d5c2 bundle2: allow pulling changegroups using bundle2
This changeset refactors the pull code to use a bundle2 when available. We keep
bundle2 disabled by default. The current code is not ready for prime time.

Ultimately we'll want to unify the API of `bunde10` and `bundle20` to have less
different code. But for now, testing the bundle2 exchange flow is an higher
priority.
2014-04-01 23:41:32 -07:00
Pierre-Yves David
6bd17e6e6c bundle2: add an exchange.getbundle function
This function can return a `HG10` or `HG20` bundle. It uses the `bundlecaps`
parameters to decides which one to return.

This is a distinct function from `changegroup.getbundle` for two reasons. First
the APIs of `bundle10` and `bundle20` are not compatible yet. The two functions
may be reunited in the future. Second `exchange.getbundle` will grow parameters
for all kinds of data (phases, obsmarkers, ...) so it's better to keep the
changegroup generation in its own function for now.

This function will be used it in the next changesets.
2014-04-04 01:51:54 -07:00
Pierre-Yves David
c2ce1e9068 localpeer: propagate bundlecaps in getbundle call
Best arguments are the ones in use...
2014-04-04 01:33:20 -07:00
Pierre-Yves David
ece6aaecdb bundle2: make it possible have a global transaction for the unbundling
We use the `gettransaction` method approach already used for pull. We
need this because we do not know beforehand if the bundle needs a
transaction to be created. And (1) we do not want to create a
transaction for nothing. (2) Some bundle2 bundles may be read-only and
do not require any lock or transaction to be held.
2014-04-02 23:56:49 -07:00
Pierre-Yves David
11a11c0625 bundle2: first crude version of bundling changeset with bundle2
The current changegroup format is put in a "changegroup" part and processed by
an appropriate handlers.

This is not production ready code, but let us start smoke testing.
2014-03-24 19:37:59 -07:00
Pierre-Yves David
5ab0b5facf bundle2: record processing results in the bundleoperation object
Part handlers can now add records to the `bundleoperation` object. This can be
used to help other parts or to let the caller of the unbundling process react
to the results.
2014-04-02 22:37:50 -07:00
Pierre-Yves David
15e3869bad bundle2: introduce a bundleoperation object
This object will hold all data and state gathered through the processing of a
bundle. This will allow:

- each handler to be aware of the things unbundled so far
- the caller to retrieve data about the execution
- bear useful object and logic (like repo, transaction)
- bear possible bundle2 reply triggered by the unbundling.

For now the object is very simple but it will grow at the same time as the
bundle2 implementation.
2014-04-02 22:24:44 -07:00
Pierre-Yves David
ef32c25a27 bundle2: feed a unbundle20 to the processbundle function
The unbundle can comes from multiple sources. (on disk file, peer, etc) and
(ultimately) of multiple type (bundle10, bundle20). The `processbundle` is no
longer in charge of creating the bundle.
2014-04-02 13:50:57 -07:00
Mads Kiilerich
a0f70f6a56 merge: keep destination filename as key in filemerge actions
Gives more readable debug output and makes it possible to compare/merge actions
later.
2014-03-02 18:52:16 +01:00
Mads Kiilerich
897b2ac8d9 merge: keep destination filename as key in actions for merge with dir rename
Avoids
   None: local renamed directory to b/c -> d
  updating:None 1/1 files (100.00%)
and makes it possible to compare/merge actions later.
2014-03-02 18:49:36 +01:00
Mads Kiilerich
71486dc145 merge: include ancestor node in merge actions 2014-02-28 02:38:33 +01:00
Matt Mackall
e10cab8769 merge with stable 2014-04-04 14:01:25 -05:00
Sean Farley
320875017e repoview: use _gethiddenblockers in computehidden
No functionality has changed, since we've only extracted the code into its own
function. Now extensions can wrap _gethiddenblockers to provide their own
blocker without polluting bookmarks or local tags.
2014-03-28 12:51:05 -05:00
Sean Farley
844f2d5df4 repoview: add _gethiddenblockers method
This is a standalone function that will provide the ability for extensions to
wrap.
2014-04-03 20:07:42 -05:00
Sean Farley
13250b1f33 repoview: improve performance for computehidden (issue4206)
For repos with a large number of heads (including hidden heads), a stale tag
cache would cause computehidden to be drastically slower because of a the call
to repo.tags() (which would build the tag cache).

We actually don't need the tag cache for computehidden because we filter out
global tags. This patch replaces the call to repo.tags with readlocaltags so
as to avoid the tag cache.
2014-03-27 20:14:55 -05:00
Pierre-Yves David
6b9778c026 localrepo: move the addchangegroup method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had few callers, not enough to be kept in local repo.
2014-04-01 15:27:53 -07:00
Pierre-Yves David
4d81b98c1e localrepo: move the addchangegroupfiles method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had a single caller, far too few for being kept in local repo.
2014-04-01 15:21:56 -07:00
Pierre-Yves David
8e0876686d localrepo: move the changegroup method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had few callers, not enough to be kept in local repo.

The peer API stay unchanged.
2014-04-01 15:08:27 -07:00
Pierre-Yves David
30f24fdb7a localrepo: move the getbundle method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had few callers, not enough to be kept in local repo.

The peer API remains unchanged.
2014-04-01 14:40:35 -07:00
Matt Mackall
9f82e04c09 store: drop unused existing list 2014-04-03 12:59:12 -05:00
Pierre-Yves David
47880ff5c9 localrepo: move the getlocalbundle method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had 3 callers total, far too few for being kept in local repo.
2014-04-01 14:33:23 -07:00
Pierre-Yves David
f14b79a23f localrepo: move the changegroupsubset method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had few callers, not enough to be kept in local repo.

The peer API remains unchanged.
2014-04-01 14:25:03 -07:00
Pierre-Yves David
eb9e40c9b6 localrepo: move the changegroupinfo method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had a single caller... already in this changegroup module.
2014-04-01 14:13:34 -07:00
Pierre-Yves David
691e520cd5 localrepo: move the _changegroupsubset method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.

The method had 3 callers total, far too few for being kept in local repo.
2014-04-01 13:59:55 -07:00
Pierre-Yves David
8ab4eab6ab push: pass a pushoperation object to localrepo.checkpush
The `pushoperation` object contains strictly more data the arguments currently
passed to `localrepo.checkpush` we pass the new object instead. This function is
used by MQ to abort push that includes MQ changesets.

Note: extension that may use this function will have to align.
2014-04-01 13:45:48 -07:00
Pierre-Yves David
c6617aef8a wireproto: use decorator for the ubundle command 2014-03-28 14:43:30 -07:00
Pierre-Yves David
04af30a7a2 wireproto: use decorator for the stream command 2014-03-28 14:43:11 -07:00
Pierre-Yves David
5dd8ba7d3d wireproto: use decorator for the pushkey command 2014-03-28 14:42:55 -07:00
Pierre-Yves David
99c03cd1e0 wireproto: use decorator for the lookup command 2014-03-28 14:42:38 -07:00
Pierre-Yves David
fe6ed0903b wireproto: use decorator for the listkeys command 2014-03-28 14:42:21 -07:00
Pierre-Yves David
32d30d0970 wireproto: use decorator for the known command 2014-03-28 14:42:06 -07:00
Pierre-Yves David
8a8b960d73 wireproto: use decorator for the hello command 2014-03-28 14:40:44 -07:00
Pierre-Yves David
997e84e937 wireproto: use decorator for the heads command 2014-03-28 14:40:31 -07:00
Pierre-Yves David
73981cbf16 wireproto: use decorator for the getbundle command 2014-03-28 14:40:07 -07:00
Pierre-Yves David
a82db7631c wireproto: use decorator for the debugwireargs command 2014-03-28 14:39:06 -07:00
Pierre-Yves David
d39b82219d wireproto: use decorator for the changegroupsubset command 2014-03-28 14:38:40 -07:00
Pierre-Yves David
3b0626a933 wireproto: use decorator for the changegroup command 2014-03-28 14:38:19 -07:00
Pierre-Yves David
69ae194532 wireproto: use decorator for the capabilities command 2014-03-28 14:37:28 -07:00
Pierre-Yves David
d4a7f403ed wireproto: use decorator for the branches command 2014-03-28 14:37:02 -07:00
Pierre-Yves David
a0ec15e813 wireproto: use decorator for the branchmap command 2014-03-28 14:36:41 -07:00
Pierre-Yves David
16cb37a2d5 wireproto: use decorator for the between command 2014-03-28 14:36:05 -07:00
Pierre-Yves David
0797e04e6b wireproto: use decorator for the batch command 2014-03-28 14:35:36 -07:00
Pierre-Yves David
705b90da7b wireproto: add decorator for wire protocol command
Move move in the same direction we took for command line commands. each wire
protocol function will be decorated with its name and arguments.

Beside beside easier to read, this open the road to easily adding more metadata
(like security level or return type)
2014-03-28 14:30:11 -07:00
Pierre-Yves David
e3dee4d3e4 wireproto: drop the _decompress method in favor a new call type
We already have multiple call function for multiple return type. The
`_decompress` function is only used for http and seems like a layer violation.
We drop it in favor of a new call type dedicated to "stream that may be useful to
compress".
2014-03-28 14:24:13 -07:00
Pierre-Yves David
7d748aed99 wireproto: document protocol specific function of wirepeer
Those function are explicitly declared and documented now.
2014-03-28 12:29:34 -07:00
Pierre-Yves David
5d414d928b wireproto: introduce an abstractserverproto class
sshserver and webproto now inherit from an abstractserverproto class. This class
is introduced for documentation purpose.
2014-03-28 11:10:33 -07:00
Pierre-Yves David
271bd25192 wireproto: document possible return type
The wireprotocole command use a small set of class as return value. We document
the meaning of each of them.

AS my knowledge of wire protocol is fairly shallow, the documentation can
probably use improvement. But this is a better than nothing.
2014-03-28 11:37:42 -07:00
Pierre-Yves David
4d69095b80 pull: add a set of steps that remain to be done during the pull
With bundle2 we'll slowly move current steps into a single bundle2 building and
call (changegroup, phases, obsmarkers, bookmarks). But we need to keep the
old methods around for servers that do not support bundle2. So we introduce
this set of steps that remains to be done.
2014-04-01 18:56:19 -07:00
Pierre-Yves David
82aa43720e pull: put discovery step in its own function
The discovery is a full step that will grow to contain more than changesets. We
set it in its own function like all other steps.
2014-04-01 17:35:25 -07:00
Pierre-Yves David
98252a796e pull: move the cgresult logic in _pullchangeset
Logical follow up of the previous changeset. The `_pullchangeset` is now
responsible of setting the `pullop.cgresult`.
2014-04-01 17:28:21 -07:00
Pierre-Yves David
c681ad99b9 pull: move return code in the pull operation object
With bundle2 we'll have multiple code path susceptible to be responsible for
adding changeset during the pull. We move it to the pull operation to simplify
this the coming logic. The one doing the adding the changegroup will set the
value.
2014-04-01 17:21:52 -07:00
Mads Kiilerich
26a58ad0b7 merge: use ancestor filename from planning phase instead of filectx ancestor
test-merge-types.t changes a bit in flag merging. It relied on the
implementation detail that 100% identical revlog entries are reused. The revlog
reuse did that fctx.ancestor() saw an ancestor where there really not was one.
2014-02-25 20:30:08 +01:00
Durham Goode
eac8ba4613 revset: improve roots revset performance
Previously we would iterate over every item in the subset, checking if it was in
the provided args. This often meant iterating over every rev in the repo.

Now we iterate over the args provided, checking if they exist in the subset.
On a large repo this brings setting phase boundaries (which use this revset
roots(X:: - X::Y)) down from 0.8 seconds to 0.4 seconds.

The "roots((tip~100::) - (tip~100::tip))" revset in revsetbenchmarks shows it
going from 0.12s to 0.10s, so we should be able to catch regressions here in the
future.

This actually introduces a regression in 'roots(all())' (0.2s to 0.26s) since
we're now using spansets, which are slightly slower to do containment checks on.
I believe this trade off is worth it, since it makes the revset O(number of
args) instead of O(size of repo).
2014-03-31 16:03:34 -07:00
Durham Goode
13db32b575 revset: improve _descendants performance
Previously revset._descendants would iterate over the entire subset (which is
often the entire repo) and test if each rev was in the descendants list. This is
really slow on large repos (3+ seconds).

Now we iterate over the descendants and test if they're in the subset.
This affects advancing and retracting the phase boundary (3.5 seconds down to
0.8 seconds, which is even faster than it was in 2.9). Also affects commands
that move the phase boundary (commit and rebase, presumably).

The new revsetbenchmark indicates an improvement from 0.2 to 0.12 seconds. So
future revset changes should be able to notice regressions.

I removed a bad test. It was recently added and tested '1:: and reverse(all())',
which has an amibiguous output direction.  Previously it printed in reverse order,
because we iterated over the subset (the reverse part). Now it prints in normal
order because we iterate over the 1:: . Since the revset itself doesn't imply an
order, I removed the test.
2014-03-25 14:10:01 -07:00
Pierre-Yves David
9e7aaa60ee bundle2: read the whole bundle from stream on abort
When the bundle processing abort on unknown mandatory parts, we now makes sure
all the bundle content is read. This avoid leaving the communication channel in
an unrecoverable state.
2014-03-24 17:20:15 -07:00