Commit Graph

21083 Commits

Author SHA1 Message Date
Pierre-Yves David
7e653a9c0f bundle2: use HG2X in the header
The current implementation of bundle2 is still very experimental and the 3.0
freeze is yesterday. The current bundle2 format has never been field-tested, so
we rename the header to HG2X. This leaves the HG20 header available for real
usage as a stable format in Mercurial 3.1.

We won't guarantee that future mercurial versions will keep supporting this
`HG2X` format.
2014-04-17 15:27:54 -04:00
Pierre-Yves David
8495126170 bundle2: transmit capabilities to getbundle during pull
Bundle2 capabilities of the client are sent to the server in the bundlecaps
argument of `getbundle`.
2014-04-17 02:01:38 -04:00
Pierre-Yves David
30d2504741 bundle2: include client capabilities in the pushed bundle
The necessary data is now included in the `replycaps` part.
2014-04-17 14:37:24 -04:00
Pierre-Yves David
9992968890 bundle2: advertise bundle2 caps in server capabilities
We can now retrieve them from the server during push. The capabilities are
encoded the same way as in `replycaps` part (with an extra layer of urlquoting
to escape separators).
2014-04-17 01:49:20 -04:00
Pierre-Yves David
0eec02877e bundle2: add bundle2caps dict on localrepo object
This dictionary will hold bundle2-related capabilities.
2014-04-17 01:50:28 -04:00
Pierre-Yves David
9bb9dc1703 bundle2: capabilities encoding 2014-04-17 01:44:53 -04:00
Pierre-Yves David
211041404c bundle2: extract capabilities decoding
We'll need to reuse this in more places (at least pull and push).
2014-04-17 01:09:05 -04:00
Pierre-Yves David
f2ead829c7 bundle2: protect capabilities name and values with url quoting
This lift limitations of the text based encoding.
2014-04-17 01:03:33 -04:00
Pierre-Yves David
f48478a77f bundle2: support for capabilities with values
The capabilities attributes of `bundle20` is now a dictionary and the reply caps
can encode capabilities with values.
2014-04-17 11:44:49 -04:00
Pierre-Yves David
b4784becd2 bundle2: add capabilities support in replycaps part
This part now contains a list of supported capabilities.
2014-04-17 11:32:30 -04:00
Pierre-Yves David
e273dad6f6 bundle2: adds a capabilities attribute on bundler20
This attribute conveys the capabilities supported by the destination of the
bundle. It is used to decide which parts to include in the bundle.

This is currently a set but will probably be turned into a dictionary to allow
capabilities with values.
2014-04-16 23:55:59 -04:00
Pierre-Yves David
1c2cd8594e bundle2: include stderr when capturing handlers output
We do not discriminate between stdout and stderr yet. But this will do for now.
2014-04-16 23:18:27 -04:00
Pierre-Yves David
2feab6f005 ui: pushbuffer can now also capture stderr
We need an easy way to capture both stderr and stdout during bundle2 processing
of a remote bundle. This changeset adds simple changes to the `ui` class to make
this possible.

I expect the interface to change in future releases as bundle2 will probably want to
distinguish stdout and stderr. The current change will, however, do for now.
2014-04-16 23:36:57 -04:00
Pierre-Yves David
53ffee95a2 bundle2: capture remote stdout while unbundling
When a reply is built, the bundle processing will capture the output of each
handler and sends it to the client in a dedicated part.

As a side effect, this add a "remote: " prefix to destination output on local
push. This is considered okay for now as:

1. bundle2 is still experimental,
2. Matt said he could be okay to change output for bundle2,
3. This keeps the implementation simple.

This changeset does it for stdout only. stderr will be done in a future changeset.
2014-04-16 14:22:24 -04:00
Pierre-Yves David
f7d4dc294b bundle2: introduce replycaps part for on-demand reply
The bundle2 processing does not create a bundle2 reply by default anymore.  It
is only done if the client requests it with a `replycaps` part. This part is
called `replycaps` as it will eventually contain data about which bundle2
capabilities are supported by the client.

We have to add a flag to the test command to control whether a reply is
generated or not.
2014-04-16 14:09:35 -04:00
Pierre-Yves David
88fa4f238f bundle2: use an official iterparts method to unbundle parts
Explicit is better than implicit.
2014-04-16 18:41:48 -04:00
Mads Kiilerich
5a1f9b25aa merge: with merge.preferancestor=*, run an auction with bids from ancestors
The basic idea is to do the merge planning with all the available ancestors,
consider the resulting actions as "bids", make an "auction" and
automatically pick the most favourable action for each file.

This implements the basic functionality and will only consider "keep" and
"get" actions. The heuristics for picking the best action can be tweaked later
on.

By default it will only pass ctx.ancestor as the single ancestor to
calculateupdates. The code path for merging with a single ancestor is not
changed.
2014-02-28 02:52:32 +01:00
Lucas Moscovicz
2794920df6 log: changed implementation to use graphlog code
Now that revsets work in a lazy way, log code can be changed to parse every
option into a revset and then evaluate it lazily.

Now expressions like

  "hg log -b default -b ."

are converted into a revset using the same code as graphlog.
2014-02-28 15:10:56 -08:00
Mads Kiilerich
cdb11ac02d context: introduce merge.preferancestor for controlling which ancestor to pick
Multiple revisions can be specified in merge.preferancestor, separated by
whitespace. First match wins.

This makes it possible to overrule the default of picking the common ancestor
with the lowest hash value among the "best" (introduced in f19507e1bcf2).

This can for instance help with some merges where the 'wrong' ancestor is used.
There will thus be some overlap between this and the problems that can be
solved with a future 'consensus merge'.

Mercurial will show a note like
  note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
        alternatively, use --config merge.preferancestor=0f6b37dbe527
when the option is available, listing all the alternative ancestors.
2014-02-24 22:42:14 +01:00
Mads Kiilerich
81feeb72af context: tell when .ancestor picks one of multiple common ancestors heads
Show a message like
  note: using 0f6b37dbe527 as ancestor of adfe50279922 and cf89f02107e5

So far this is just a warning - there is nothing the user can do to select
another ancestor.
2014-04-17 17:32:04 +02:00
FUJIWARA Katsunori
4ea3569fd2 hgweb: align entries in "changelog" and "revisions" pages of "spartan" style
Before this patch, each log entries in "changelog" and "revisions"
pages of "spartan" style are not aligned by column, because:

  - each log entries are separated "<table>" entries, and
  - there are no fixed "width" information for each "<th>"/"<td>" entries

This patch aligns entries in "changelog" and "revisions" pages of
"spartan" style by:

  - adding 'label' class to '<th>' for 'age' information, and
  - setting 'width' of '<th class="label">' with fixed size

'class="age"' is not used for this purpose, because it is also used to
set "bold" font-weight

"16em" seems to be wide enough to show date information fully, when
web browser disables (or doesn't support) javascript.
2014-04-17 09:36:09 +09:00
FUJIWARA Katsunori
350af37dc3 hgweb: show revisions and hashes gotten from changelog in "comparison" page
Before this patch, revision numbers and hash values in "comparison"
page are gotten from not changelog but filelog.

Such filelog information is useful only for hgweb debugging, and may
confuse users.

This patch shows revision numbers and hash values gotten from
changelog in "comparison" page.
2014-04-17 09:36:09 +09:00
FUJIWARA Katsunori
62dac3c633 hgweb: show as same parents as "hg parents -r REV FILE" in pages for file
Before this patch, "parents" in pages for file doesn't show as same
parents as "hg parents -r REV FILE", when the specified file is not
modified in the specified revision.

For example, it is assumed that revision A, B and D change file "f".

    changelog   (A) ---> (B) ---> (C) ---> (D)
    filelog "f" (x) ---> (y) ------------> (z)

"/file/D/f" invokes "webutil.parents()" with filectx(z) gotten from
changectx(D), and it returns changectx(B). This is as same result as
"hg parents -r D f".

In the other hand, "/file/C/f" invokes "webutil.parents()" with
filectx(y') gotten from changectx(C), and it returns changectx(A),
because filectx(y') is linked to changectx(B), and works like
filectx(y) in some cases.

In this case, revision B is hidden from users browsing file "f" in
revision C.

This patch shows as same parents as "hg parents -r REV FILE" in pages
for file, by making "webutil.parents()" return:

  - "linkrev()"-ed revision only, if:

    - specified context instance is "filectx" (because
      "webutil.parents()" is invoked with changectx, too), and

    - (1) the revision from which filectx is gotten and (2) the one to
      which filectx is linked are different from each other

  - revision gotten from "ctx.parents()", otherwise
2014-04-17 09:36:08 +09:00
FUJIWARA Katsunori
fc4364cead hgweb: make "comparison" get parent from not filelog but changelog
Before this patch, "comparison" shows unexpected result, when the
specified file is not modified in the specified revision, even though
"diff" shows empty result.

When REV doesn't change specified FILE, "diff" shows:

  "hg diff -c REV FILE"

but "comparison" shows:

  "hg diff -c `hg parents -r REV FILE` FILE"

In other words, the former gets parent from changelog, but the latter
gets one from filelog.

This may confuse users browsing (and switching "diff" and
"comparison" of) files in the specified revision.

This patch makes "comparison" get parent from not filelog but
changelog, to show "hg diff -c REV FILE" in both "diff" and
"comparison" pages.
2014-04-17 09:36:08 +09:00
FUJIWARA Katsunori
98201640e7 hgweb: fix lack of "bookmarks" link in "/file" page of "paper" style
This patch also fixes same problem of "coal" style, because it re-uses
"filerevision.tmpl" of "paper" style.

"gitweb" and "monoblue" styles don't have such problems.

"spartan" style doesn't have "bookmarks" page definition itself.
2014-04-17 09:36:08 +09:00
Aaron Jensen
2e9eed01a1 hgweb: adding article link to rss feed 2014-04-17 11:48:22 -07:00
Aaron Jensen
a849a70906 hgweb: adding branch names from inbranch template to rss feed 2014-04-17 11:47:49 -07:00
Aaron Jensen
4ecda29bda hgweb: adding branch names from inbranch template to atom feed 2014-04-17 11:45:43 -07:00
Mads Kiilerich
eb39238a97 dirstate: report bad subdirectories as match.bad, not just a warning (BC)
This seems simpler and more correct.

The only test coverage for this is test-permissions.t when it says:
  dir: Permission denied
2013-10-03 18:01:21 +02:00
Mads Kiilerich
67a2ed988d dirstate: improve documentation and readability of match and ignore in the walker 2013-10-03 18:01:21 +02:00
Mads Kiilerich
c608411f0d context: remove redundant handling of match.bad return value
The 'bad' function is for reporting - it never returns anything.
2013-10-03 18:01:21 +02:00
Mads Kiilerich
3bb35d5e35 match: remove last traces of unused .missing callback 2013-10-03 18:01:21 +02:00
Mads Kiilerich
3811c637be match: _globre doctests 2014-04-13 22:00:08 +02:00
Mads Kiilerich
df98b5168a match: improve documentation - docstrings and more descriptive variable naming
No real changes.

pattern: 'kind:pat' as specified on the command line
patterns, pats: list of patterns
kind: 'path', 'glob' or 're' or ...
pat: string in the corresponding 'kind' format
kindpats: list of (kind, pat) tuples
2013-10-03 18:01:21 +02:00
Lucas Moscovicz
097fe28381 largefiles: changed overridelog to work with graphlog
Log for largefiles was failing for graph log since it was overriding match
instead of matchandpats.

[Mads Kiilerich modified this patch to address his review comments and ended up
rewriting/removing most of it.]
2014-03-05 15:55:09 -08:00
Lucas Moscovicz
b7ef7e0c3b largefiles: added test coverage for graph log
[Mads Kiilerich placed this patch before the patch that makes graphlog actually
work correctly for largefiles. As it is introduced here it just adds test
coverage and the actual bugfix patch will show the actual change.]
2014-03-06 14:52:07 -08:00
Lucas Moscovicz
783ebe698d cmdutil: changed _makegraphlogrevset to _makelogrevset
This method will now be used to build both graphlog and log revset after this
series of patches.
2014-02-25 10:40:04 -08:00
Mads Kiilerich
cb0184290d revlog: backout 1c95c1863327 - commonancestors 2014-04-17 20:01:39 +02:00
Mads Kiilerich
2ffa0a82ac localrepo: use commonancestorsheads for checking linear heritage in file commit
If two revisions are linearly related, there will only be one ancestor, and
commonancestors and commonancestorsheads would give the same result.
commonancestorsheads is however slightly simpler, faster and more correct.
2014-04-17 20:01:39 +02:00
Mads Kiilerich
d2c13e7d3c backout: use commonancestorsheads for checking linear heritage
If two revisions are linearly related, there will only be one ancestor, and
commonancestors and commonancestorsheads would give the same result.
commonancestorsheads is however slightly simpler, faster and more correct.
2014-04-17 20:01:39 +02:00
Mads Kiilerich
1478c563ea revlog: introduce commonancestorsheads method
Very similar to commonancestors but giving all the common ancestors heads.
2014-04-17 20:01:35 +02:00
Mads Kiilerich
6ffb3587ef parsers: remove unnecessary gca variable in index_commonancestorsheads 2014-04-17 19:58:08 +02:00
Mads Kiilerich
b73865b95b parsers: introduce index_commonancestorsheads
This is an exact copy of index_ancestors but without the final "deepest"
pruning.
2014-02-24 22:42:14 +01:00
Mads Kiilerich
acc676f65f ancestors: extract candidates function as commonancestorsheads 2014-04-17 19:49:56 +02:00
Mads Kiilerich
638e3b7e24 filemerge: better handling of failing remove of temporary files
We have seen some failures on Windows that could seem like the unlinks of
temporary files were failing. That could perhaps be because the merge tool
somehow still held the files open.

Instead of the bare bone os.unlink, use our util.unlink with special
rename/retry handling on Windows.
2014-04-17 14:54:46 +02:00
Mads Kiilerich
87448a2943 contrib: remove mergetools.hgrc premerge=False for Beyond Compare and Araxis
There can be good reasons to disable premerge no matter which merge tool is
used. Most tools will do just fine without premerge and handle the simple
merges more or less automatic and silent. We _could_ thus disable premerge for
most tools. But without premerge, the merge tool will be launched for each file
- that makes it a slow and expensive process to perform big simple merges. It
  is thus better to consistently stick to the default premerge=True.

The mergetools.hgrc configuration for most tools implicitly use the default
premerge=True but Araxis and the Linux entry for Beyond Compare had
premerge=False. These lines has been removed.

These settings were introduced by de7cda55270e without further explanation of
why they should be good.

(We have seen some crashes on Windows with Araxis where a merge failed after a
lot of Araxis flashing. I haven't been able to reproduce it and do not know
exactly what happened. Enabling premerge avoids the problems.)
2014-04-17 14:54:46 +02:00
FUJIWARA Katsunori
87f58fc092 obsolete: add '%' specifier to the format string to avoid TypeError at runtime
Mapping operation on the format string not including any '%'
specifiers causes TypeError at runtime.
2014-04-16 03:05:00 +09:00
FUJIWARA Katsunori
0ba1f1ddab check-code: detect "% inside _()" when there are leading whitespaces
Before this patch, "contrib/check-code.py" can't detect "% inside _()"
correctly, when there are leading whitespaces before the format
string, like below:

    _(
      "format string %s" % v)

This patch adds regexp pattern "[ \t\n]*" before the pattern matching
against the format string.

"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
2014-04-16 03:05:00 +09:00
FUJIWARA Katsunori
c0e0086074 i18n: fix "% inside _()" problem 2014-04-16 03:05:00 +09:00
Mads Kiilerich
fafe3113c1 largefiles: revert override, install matchfn outside the try/except restoring it 2014-04-13 18:45:43 +02:00