Commit Graph

9756 Commits

Author SHA1 Message Date
Mads Kiilerich
09567db49a spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
timeless@mozdev.org
ff22eee5cd mq: consistently use qrefresh 2015-10-14 03:30:27 -04:00
timeless
ad39e57a72 test-shelve: do not use non-portable pipe-and 2015-10-15 20:32:01 -04:00
Pierre-Yves David
ede81c8447 test: enforce v1 type in 'test-bundle2-remote-changegroup.t'
This bundle command is meant to generate a bundle1, we enforce that to avoid
test's misbehavior when moving to general-delta by default.
2015-10-16 02:53:57 +01:00
Pierre-Yves David
790b968ac9 test: enforce v1 type in 'test-bundle2-format.t'
This bundle command is meant to generate a bundle1, we enforce that to avoid
test's misbehavior when moving to general-delta by default.
2015-10-16 02:51:34 +01:00
Durham Goode
6c10065cf4 histedit: make histedit prune when obsolete is enabled
Back in June we made histedit use obsolete markers to cleanup when possible.
This was rolled back as part of bb3db0db4037 (which should have only rolled back
the --abort stuff, but rolled back everything). This caused a nasty bug when
used in conjuction with the inhibit+directaccess extensions where histedit would
leave old nodes around even after they had been squashed away.

The root of the problem is that we first clean up old nodes, and then we clean
up temp nodes. In the first pass, when we obsoleted old nodes, some would become
unobsolete because they had temp nodes on top of them, thus making them stick
around even after the histedit finished.

The fix is to A) move the temp node cleanup to be before the old node cleanup
(since they are topological on top of the old nodes), and B) use obsolete
markers instead of stripping.
2015-10-17 12:32:23 -07:00
Gregory Szorc
508a4655f7 clonebundles: rewrite documentation
There are a lot of considerations server operators need to know before
deploying clone bundles. They should be documented. So I rewrote the
extension docs to contain this information.
2015-10-17 11:23:54 -07:00
Gregory Szorc
53a1c4895e exchange: support streaming clone bundles in clone bundles
Now that we have support for detecting compatible stream clone bundles
in bundle specifications, we can safely add support for applying stream
clone bundles to the clone bundles feature.
2015-10-17 11:37:08 -07:00
Gregory Szorc
ae85c846e7 commands: support consuming stream clone bundles
For the same reasons that we don't produce stream clone bundles with `hg
bundle`, we don't support consuming stream clone bundles with `hg
unbundle`. We introduce a complementary debug command for applying
stream clone bundles. This command is mostly to facilitate testing.
Although it may be used to manually apply stream clone bundles until a
more formal mechanism is (possibly) adopted.
2015-10-15 13:43:18 -07:00
Gregory Szorc
e52d35ae6b commands: support creating stream clone bundles
Now that we have support for recognizing the streaming clone bundle
type, add a debug command for creating them.

I decided to create a new debug command instead of adding support to `hg
bundle` because stream clone bundles are not exactly used the same way
as normal bundle files and I don't want to commit to supporting them
through the official `hg bundle` command forever. A debug command,
however, can be changed without as much concern for backwards
compatibility.

As part of this, `hg bundle` will explicitly reject requests to produce
stream bundles.

This command will be required by server operators using stream clone
bundles with the clone bundles feature.
2015-10-17 11:40:29 -07:00
FUJIWARA Katsunori
75f4bab4a5 merge: make in-memory changes visible to external update hooks
c67339617276 (while 3.4 code-freeze) made all 'update' hooks run after
releasing wlock for visibility of in-memory dirstate changes. But this
breaks paired invocation of 'preupdate' and 'update' hooks.

For example, 'hg backout --merge' for TARGET revision, which isn't
parent of CURRENT, consists of steps below:

  1. update from CURRENT to TARGET
  2. commit BACKOUT revision, which backs TARGET out
  3. update from BACKOUT to CURRENT
  4. merge TARGET into CURRENT

Then, we expects hooks to run in the order below:

  - 'preupdate' on CURRENT for (1)
  - 'update'    on TARGET  for (1)
  - 'preupdate' on BACKOUT for (3)
  - 'update'    on CURRENT for (3)
  - 'preupdate' on TARGET  for (4)
  - 'update'    on CURRENT/TARGET for (4)

But hooks actually run in the order below:

  - 'preupdate' on CURRENT for (1)
  - 'preupdate' on BACKOUT for (3)
  - 'preupdate' on TARGET  for (4)
  - 'update'    on TARGET  for (1), but actually on CURRENT/TARGET
  - 'update'    on CURRENT for (3), but actually on CURRENT/TARGET
  - 'update'    on CURRENT for (4), but actually on CURRENT/TARGET

Root cause of the issue focused by c67339617276 is that external
'update' hook process can't view in-memory changes (especially, of
dirstate), because they aren't written out until the end of
transaction (or wlock).

Now, hooks can be invoked just after updating, because previous
patches made in-memory changes visible to external process.

This patch may break backward compatibility from the point of view of
"scheduling hook execution", but should be reasonable because 'update'
hooks had been executed in this order before 3.4.

This patch tests "hg backout" and "hg unshelve", because the former
activates the transaction before 'update' hook invocation, but the
former doesn't.
2015-10-17 01:15:34 +09:00
FUJIWARA Katsunori
8f93d72f88 hook: centralize passing HG_PENDING to external hook process
This patch centralizes passing HG_PENDING to external hook process
into '_exthook()'. To make in-memory changes visible to external hook
process, this patch does:

  - write (or schedule to write) in-memory dirstate changes, and
  - set HG_PENDING environment variable, if:
    - a transaction is running, and
    - there are in-memory changes to be visible

This patch tests some commands with some hooks, because transaction
activity of a same hook differs from each other ("---": "not tested").

    ======== ========= ========= ============
    command  preupdate precommit pretxncommit
    ======== ========= ========= ============
    unshelve   o        ---       ---
    backout    x        ---       ---
    import     ---       o         o
    qrefresh   ---       x         o
    ======== ========= ========= ============

Each hooks are examined separately to prevent in-memory changes from
being visible to external process accidentally by side effect of hooks
previously invoked.
2015-10-17 01:15:34 +09:00
FUJIWARA Katsunori
36207b46bf cmdutil: make in-memory changes visible to external editor (issue4378)
Before this patch, external editor process for the commit log can't
view some in-memory changes (especially, of dirstate), because they
aren't written out until the end of transaction (or wlock).

This causes unexpected output of Mercurial commands spawned from that
editor process.

To make in-memory changes visible to external editor process, this
patch does:

  - write (or schedule to write) in-memory dirstate changes, and
  - set HG_PENDING environment variable, if:
    - a transaction is running, and
    - there are in-memory changes to be visible

"hg diff" spawned from external editor process for "hg qrefresh"
shows:

  - "changes newly imported into the topmost" before ab68b153ce34(*)
  - "all changes recorded in the topmost by refreshing" after this patch

(*) ab68b153ce34 changed steps invoking editor process

Even though backward compatibility may be broken, the latter behavior
looks reasonable, because "hg diff" spawned from the editor process
consistently shows "what changes new revision records" regardless of
invocation context.

In fact, issue4378 itself should be resolved by b46029eb5b29, which
made 'repo.transaction()' write in-memory dirstate changes out
explicitly before starting transaction. It also made "hg qrefresh"
imply 'dirstate.write()' before external editor invocation in call
chain below.

  - mq.queue.refresh
    - strip.strip
      - repair.strip
        - localrepository.transaction
          - dirstate.write
    - localrepository.commit
      - invoke external editor

Though, this patch has '(issue4378)' in own summary line to indicate
that issues like issue4378 should be fixed by this.

BTW, this patch adds '-m' option to a 'hg ci --amend' execution in
'test-commit-amend.t', to avoid invoking external editor process.

In this case, "unsure" states may be changed to "clean" according to
timestamp or so on. These changes should be written into pending file,
if external editor invocation is required,

Then, writing dirstate changes out breaks stability of test, because
it shows "transaction abort!/rollback completed" occasionally.

Aborting after editor process invocation while commands below may
cause similar instability of tests, too (AFAIK, there is no more such
one, at this revision)

  - commit --amend
    - without --message/--logfile

  - import
    - without --message/--logfile,
    - without --no-commit,
    - without --bypass,
    - one of below, and
      - patch has no description text, or
      - with --edit
    - aborting at the 1st patch, which adds or removes file(s)
      - if it only changes existing files, status is checked only for
        changed files by 'scmutil.matchfiles()', and transition from
        "unsure" to "normal" in dirstate doesn't occur (= dirstate
        isn't changed, and written out)
      - aborting at the 2nd or later patch implies other pending
        changes (e.g. changelog), and always causes showing
        "transaction abort!/rollback completed"
2015-10-17 01:15:34 +09:00
Tony Tung
4c1f5709e1 commit: abort when a committemplate is not changed
If a committemplate is provided and no message is provided on the
command line, and no edits are made to the commit template, then abort
the commit.
2015-10-09 21:44:54 -07:00
Gregory Szorc
73c33b60d4 keepalive: use print function 2015-06-21 23:14:54 -07:00
Gregory Szorc
edf696301c dispatch: use print function
Python 3 doesn't have a print statement.
2015-06-21 21:45:41 -07:00
timeless
c09ee5764f help: include section heading if section depth changes
This makes it easier to distinguish between:

"format"
--------
"usestore"
...
    Enabled by default.

and

"progress.format"
    Format of the progress bar.
2016-01-01 16:59:13 +00:00
Matt Mackall
d7ec07e23e merge with stable 2016-01-02 02:13:56 +01:00
timeless
c93f79b92f run-tests: fix get port to try differing ports
The code was moving its offset each time through the loop,
but because it failed to update port, the port was not
going to be available...
2015-12-29 04:30:38 +00:00
Augie Fackler
f19af9e9c4 httpclient: update to 938f2107d6e2 of httpplus
This enhances proxy support in httpclient a little bit, though I don't
know that we used that functionality at all. It also switches httpplus
to using absolute_import.
2015-12-31 13:19:20 -05:00
Siddharth Agarwal
1c3dcd1546 filemerge: default change/delete conflicts to 'leave unresolved' (BC)
It makes far more sense to leave these conflicts unresolved and kick back to
the user than to just assume that the local version be chosen. There are almost
certainly buggy scripts and applications using Mercurial in the wild that do
merges or rebases non-interactively, and then assume that if the operation
succeeded there's nothing the user needs to pay attention to.

(This wasn't possible earlier because there was no way to re-resolve
change/delete conflicts -- but now it is.)
2015-12-23 12:51:45 -08:00
Siddharth Agarwal
3e8ef339ef tests: explicitly request changed version in test-rebase-newancestor.t
We're going to change the default for this in an upcoming patch, but in this
instance we do want to continue picking the changed version.
2015-12-23 12:41:20 -08:00
Siddharth Agarwal
5268761dce tests: explicitly request changed version in c/d conflict in test-commit-amend.t
We're going to change the default for this in an upcoming patch, but in this
instance we do want to continue picking the changed version.
2015-12-23 12:41:20 -08:00
Siddharth Agarwal
2079df3c0d test-copy-move-merge.t: explicitly request changed version
We're going to change the default for this in an upcoming patch, but in this
instance we do want to continue picking the changed version.
2015-12-23 12:41:20 -08:00
Laurent Charignon
ffd341931d dirstate: add test for non-normal set consistency
This adds a test extension to check that the non-normal set contains the
expected entries. It wraps several methods of the dirstate to check that
the non-normal set has the correct values before and after the call. The
extension lives in contrib so that paranoid developers can easily
enable it to make sure that the non-normal set is consistent across more
complex operations than the included tests.
2015-12-21 16:26:44 -08:00
FUJIWARA Katsunori
4d06739a86 revset: use delayregistrar to register predicate in extension easily
Previous patch introduced 'revset.predicate' decorator to register
revset predicate function easily.

But it shouldn't be used in extension directly, because it registers
specified function immediately. Registration itself can't be restored,
even if extension loading fails after that.

Therefore, registration should be delayed until 'uisetup()' or so.

This patch uses 'extpredicate' decorator derived from 'delayregistrar'
to register predicate in extension easily.

This patch also tests whether 'registrar.delayregistrar' avoids
function registration if 'setup()' isn't invoked on it, because
'extpredicate' is the first user of it.
2015-12-29 23:58:30 +09:00
Gregory Szorc
a3e59a30b6 hgweb: support rendering a sub-topic
If the requested topic contains a "." we assume a sub-topic is
requested and display it.
2015-12-30 17:15:10 -07:00
Gregory Szorc
a320e743a7 hgweb: support rendering sub-topic indexes
If the requested topic name is the name of a sub-topic, we now render
an index of topics within that sub-topic.
2015-12-30 17:34:51 -07:00
Gregory Szorc
627d3b55af templates: make earlycommands and othercommands optional
We now have sub-topics in the help system. The "helptopics" template
serves as a mechanism for displaying an index of help topics.
Previously, it was only used to show the top-level list of help topics,
which includes special groupings of topics.

In the near future, we'll adapt "helptopics" for showing the index
of sub-topics. In this patch, we optionally render {earlycommands} and
{othercommands} since they aren't present on sub-topics.
2015-12-30 17:12:59 -07:00
Laurent Charignon
901d6a2088 rebase: better error message when rebased changes are all in destination
Before this patch, when rebasing a set of obsolete revisions that were plain
pruned or already present in the destination, we were displaying:

abort: no matching revisions

This was not very helpful to understand what was going on, instead we replace
the error message by:

abort: all requested changesets have equivalents or were marked as obsolete
(to force the rebase, set the config experimental.rebaseskipobsolete to False)
2015-12-29 15:32:12 -08:00
Eric Sumner
c24dabdde6 lrucachedict: add copy method
This diff implements the standard dict copy() method for lrucachedicts, which
will be used in the pushrebase extension to make a copy of the manifestcache.
2015-12-30 13:10:53 -08:00
Matt Mackall
725a0fc8db merge with stable 2015-12-31 09:55:56 +01:00
timeless
895fc55886 tests: add test-check-execute.t
Try to prevent people from adding files with incorrect execute bits
2015-12-22 11:05:56 +00:00
timeless
2a6d0ff53a run-tests: avoid double counting server fails 2015-12-28 16:01:31 +00:00
timeless
da9e1e1cb0 run-tests: report missing feature for skipped tests 2015-12-22 08:00:03 +00:00
Danek Duvall
7653e06efa tests: Solaris diff -U also emits "No differences encountered"
This came up before, but the tests in check-code.py don't find -U (only -u)
and they don't work when the diff is inside a shell function.  This fixes
the offending tests and beefs up check-code.py.
2015-12-27 15:24:48 -08:00
Augie Fackler
3fdeab8ee1 test-glog: avoid check-code violation after next patch
Danek's patch will help us avoid spurious test breakages on
Solaris. This test wasn't broken on Solaris because of the grep(1)
use, but it will upset check-code. Use cmp to silence check-code since
it doesn't matter.
2015-12-29 18:11:14 -05:00
Yoshinari Takaoka
009206a571 hgweb: fixed invalid atom-log feed url in file log page
currently "subscribe to atom feed" link in file log page is as follows.

/atom-log/[revision]/[file]

This is invalid, because we could not get newer commit feed than [revision].
To fix this, atom-log feed url should be the following style.

atom-log/tip/[file]
2015-12-29 00:48:03 +09:00
timeless
303f2b32c3 histedit: handle exceptions from node.bin in fromrule 2015-12-23 23:51:29 +00:00
timeless
2e291bf611 histedit: limit cleanup of histedit-last-edit.txt to success 2015-12-23 23:23:28 +00:00
timeless
f32fa41604 histedit: use parse-error exception for parsing 2015-12-27 03:33:09 +00:00
timeless
77bfa3d9b2 test-histedit-edit: test histedit with dirty repo 2015-12-11 07:08:36 +00:00
timeless
d96f3f0401 histedit: check fold of public change during verify 2015-12-28 22:53:22 +00:00
Bryan O'Sullivan
41f0aebc57 test-bundle2-format: force gc so a GeneratorExit will be thrown
PyPy has looser semantics than CPython for when a generator's close
method will be called.  Forcing the gc causes it to be called at
the right moment.
2015-12-23 16:22:20 -08:00
Bryan O'Sullivan
d17fc62ed2 test-bad-extension: account for PyPy/CPython error difference 2015-12-23 16:22:20 -08:00
Bryan O'Sullivan
3002054ec0 test-demandimport: ensure that relative imports are deferred
This adds a test not just at our local "top level" (the mercurial
package), but also one level deeper (mercurial.hgweb).
2015-12-23 16:22:20 -08:00
Matt Mackall
798e034a3c merge with stable 2015-12-28 10:11:48 -06:00
Bryan O'Sullivan
7cd156ddd3 perf: close transaction in perffncachewrite
This fixes a bug, and brings CPython behaviour on this test into
line with PyPy.
2015-12-27 23:55:54 +09:00
Bryan O'Sullivan
cf9489897c eol: make output stable
This eliminates a divergence in behaviour between PyPy and Python.
2015-12-27 23:55:54 +09:00
Gregory Szorc
9859c8fd09 exchange: use absolute_import 2015-12-23 12:32:08 -08:00
Gregory Szorc
4ccb8aa7b3 localrepo: use absolute_import 2015-12-23 12:30:14 -08:00
Gregory Szorc
2a56f0283f httpconnection: use absolute_import 2015-12-21 21:52:58 -08:00
Yuya Nishihara
75e54f0d1a test-install: embed wix namespace for Python 2.6 compatibility
According to doc, the syntax is "{uri}tag".

https://docs.python.org/2.7/library/xml.etree.elementtree.html#parsing-xml-with-namespaces
2015-12-23 22:48:48 +09:00
timeless
998fd9af34 fileset: add hint for list error to use or 2015-12-23 17:54:13 +00:00
timeless
60432cef00 revset: add hint for list error to use or 2015-12-23 17:54:03 +00:00
Matt Harbison
41b4785ddb test-run-tests: glob away a --debug run difference on Windows
This internal test is piped through 'grep -v pwd' to eliminate the pwd alias set
when running with MSYS.  Unfortunately, the '.' from the successful run of the
prior internal test precedes the pwd alias for the next test on the same line,
so grep filters out '.' too, except for the final test.

It also looks like there may be a bug with --debug: the output of the internal
test that had this diff says 2 ran, 0 failed (one test being test-failure.t),
but if --debug is omitted from the internal test, then it says 2 ran, 1 failed.

With this longstanding issue fixed, the test suite finally runs cleanly on
Windows (except subrepo merge documented in issue 4988), with 88 skips.  \o/
2015-11-23 12:14:01 -05:00
Gregory Szorc
ccd1a37a31 keepalive: use absolute_import 2015-12-22 16:28:28 -08:00
Gregory Szorc
a12b0c85e9 context: use absolute_import 2015-12-21 21:51:31 -08:00
Gregory Szorc
69a8c50d7e lsprofcalltree: use absolute_import 2015-12-21 21:44:15 -08:00
Gregory Szorc
8e54d63538 byterange: use absolute_import
There were a lot of imports scattered around this file. They have been
consolidated at the top of the file where they belong.
2015-12-21 21:42:14 -08:00
Gregory Szorc
061e8691b5 dirstate: use absolute_import 2015-12-21 21:38:53 -08:00
Gregory Szorc
d6f69e17c6 manifest: use absolute_import 2015-12-21 21:35:46 -08:00
Gregory Szorc
fbecdd00e5 pvec: use absolute_import 2015-12-21 21:32:58 -08:00
timeless
329c86706d tests: add execute bit and fix shbang line 2015-12-22 11:05:05 +00:00
Gregory Szorc
e8cdc56137 perf: use standard arguments for perfrevlog
We have a convention of using -c|-m|FILE elsewhere for reading from
revlogs. Use it for `hg perfrevlog`.

While I was here, I also added a docstring to document what this
command does, as "perfrevlog" is ambiguous.
2015-12-20 19:45:55 -08:00
Jun Wu
8663e10abb test-extension: do not depend on demandimport (issue5012)
When demandimport is disabled, the test will fail because extroot/foo.py uses
import outside PYTHONPATH. This is bad since we have a PyPy migration plan and
it does not support demandimport. Fix by setting PYTHONPATH.
2015-12-18 09:47:21 +00:00
timeless
c754b0afd2 remove: quote --force in never deletes note
Split Note into a note container
2015-12-22 06:02:01 +00:00
Gregory Szorc
3abe9bcc8e py3compat: use absolute_import 2015-12-21 21:31:57 -08:00
Gregory Szorc
090eb4dcbe patch: use absolute_import 2015-12-21 21:33:52 -08:00
Gregory Szorc
ffa0c7e97c mdiff: use absolute_import 2015-12-21 21:26:14 -08:00
Gregory Szorc
4b6a93ce1c scmposix: use absolute_import 2015-12-21 21:24:49 -08:00
Gregory Szorc
4602d8f855 scmutil: use absolute_import 2015-12-21 21:23:43 -08:00
Gregory Szorc
2895e45846 scmwindows: use absolute_import 2015-12-21 21:21:09 -08:00
Gregory Szorc
dfef101207 store: use absolute_import 2015-12-21 21:19:57 -08:00
Gregory Szorc
68a8e8f9f4 help: use absolute_import 2015-12-21 21:33:27 -08:00
Matt Harbison
767b7626b1 test-commit-interactive: updates for the no-execbit case
This goes with b0f02d371155 and 862e38e6beed.
2015-12-21 20:29:32 -05:00
Matt Harbison
996ae5279d test-fileset: conditionalize output with symlink 2015-12-21 20:18:06 -05:00
timeless
a433b637d1 commands: the first word of each note should be capital or hg 2015-12-22 02:24:16 +00:00
Gregory Szorc
9f75546b76 perf: add perfrevlogrevision
As part of investigating performance improvements to revlog reading,
I needed a mechanism to measure every part of revlog reading so I knew
where time was spent and how effective optimizations were.

This patch implements a perf command for benchmarking the various
stages of reading a single revlog revision.

When executed against a manifest revision at the end of a 30,000+
long delta chain in mozilla-central, the command demonstrates that
~80% of time is spent in zlib decompression.
2015-12-20 18:38:21 -08:00
FUJIWARA Katsunori
2cb14bf8f0 fileset: detect unintentional existing() invocation at runtime
A fileset predicate can invoke 'matchctx.existing()' successfully,
even if it isn't marked as "existing caller". It is aborted only in
some corner cases: e.g. there were one deleted file in the working
directory (see 2c5c0790cbcc for detail).

This patch makes 'matchctx.existing()' invocation abort if not
'_existingenabled', which is true only while "existing caller"
running.

After this changes, non-"existing caller" predicate function is
aborted immediately, whenever it invokes 'matchctx.existing()'. This
prevent developer from forgetting to mark a predicate as "existing
caller".

BTW, unintentional 'matchctx.status()' invocation can be detected
easily without any additional trick like this patch, because it
returns 'None' if a predicate isn't marked as "status caller", and
referring field (e.g. '.modified') of it is always aborted.
2015-12-21 22:31:16 +09:00
FUJIWARA Katsunori
655c371178 fileset: treat encoding and eol as the predicate calling _existing
Before this patch, predicate function 'encoding' and 'eol' aren't
listed up in '_existingcallers', even though they invoke 'existing()'.

This causes unexpected failure of these predicate, if there is a
(manually) deleted file in the working directory.

2c5c0790cbcc and 12b403664548 seem to overlook putting already
existing 'encoding' or newly introduced 'eol' into '_existingcallers'.

This patch also changes order of fileset "eol(unix)" output in test,
because "existing caller" predicates show "A(dded)" files before
"C(lean)" ones.
2015-12-21 22:31:16 +09:00
timeless
78ff92a147 diff: clarify comparison as first parent 2015-12-18 18:52:25 +00:00
timeless
4d95bd2b9d histedit: add progress support 2015-12-18 06:19:22 +00:00
Matt Harbison
85a68ab949 test-install: perform the wix checking on wdir() instead of "."
This allows catching problems before they are committed.
2015-12-17 21:18:02 -05:00
Matt Harbison
3cab7ba2f7 tests: convert directory separators to '/' for MSYS in test-check-py-compat
This is the same fix as ca24c20a1c94.
2015-12-16 17:22:37 -05:00
Matt Harbison
6d5700eb1f tests: make pwd URL compatible on Windows in test-default-push
Without this, the test fails with:

  $ hg -q commit -A -m 'add pushurl'
  abort: file:// URLs can only refer to localhost
  $ hg push
  abort: file:// URLs can only refer to localhost

The variable $PWD causes check-code to complain, so avoid that.
2015-12-16 17:17:36 -05:00
Augie Fackler
e4e988fdf5 changegroups: add documentation for cg3 2015-12-18 09:57:35 -05:00
Mike Edgar
44af48ee4a changegroup: add flags field to cg3 delta header
This lets revlog flags be transmitted over the wire. Right now this is
useful for censored nodes and for narrowhg's ellipsis nodes.
2015-12-14 15:55:12 -05:00
Augie Fackler
d33d6a0cb5 changegroup: introduce cg3, which has support for exchanging treemanifests
I'm not entirely happy with using a trailing / on a "file" entry for
transferring a treemanifest. We've discussed putting some flags on
each file header[0], but I'm unconvinced that's actually any better:
if we were going to add another feature to the cg format we'd still be
doing a version bump anyway to cg4, so I'm inclined to not spend time
coming up with a more sophisticated format until we actually know what
the next feature we want to stuff in a changegroup will be.

Test changes outside test-treemanifest.t are only due to the new CG3
bundlecap showing up in the wire protocol.

Many thanks to adgar@google.com and martinvonz@google.com for helping
me with various odd corners of the changegroup and treemanifest API.

0: It's not hard refactoring, nor is it a lot of work. I'm just
disinclined to do speculative work when it's not clear what the
customer would actually be.
2015-12-11 11:23:49 -05:00
timeless
86a42ddbf7 add: mention .hgignore in help 2015-12-17 14:53:40 +00:00
timeless
ef7cfdfced bundle: warn for --base with --all 2015-12-17 15:05:25 +00:00
timeless
3db2ef2e04 bundle: fix error for --all with destination
Before it complained about --base
2015-12-17 15:03:45 +00:00
Yuya Nishihara
664cff6605 cmdutil: do not duplicate stdout by makefileobj()
It made output order unpredictable because two separate buffers are flushed
individually. Let's use a thin wrapper that just sends close() to black hole.
2015-12-13 20:07:19 +09:00
Yuya Nishihara
00a04ad77b export: do not print '<fdopen>' as an output filename
Because makefileobj() duplicates or wraps stdout, "fp != sys.stdout" didn't
work correctly. Python doc states that special file objects are named in the
form '<...>', and absolute filenames should never start with '<', we can
ignore names start with '<'. We can't test fp.fileno() because fp may be a
command-server channel.

https://docs.python.org/2.7/library/stdtypes.html#file.name

In the test output, "exporting patch:" line is printed after patch content.
This is caused by fdopen() and will be fixed by the subsequent patch.
2015-12-13 19:47:46 +09:00
Mateusz Kwapich
011f0f625e histedit: delete to drop
The default behaviour to forbid this makes a lot of sense for novice users
because it's safeguarding them from dangerous behavior but making it
configurable will be apprieciated by power users in at least one big
organization.

It allows an user to look an histedit rules from declarative perspective and
make the rules reflect the state after histedit.  If we can move lines t move
commits why can't we drop lines to drop commits?

Let's put this behind config knob and inform users about this feature the very
moment they are trying to use it so they can choose desired behaviour.
2015-12-15 13:27:09 -08:00
timeless
b7d4dff7f3 record: fix hunk handling to remember the current function 2015-12-17 20:13:29 +00:00
timeless
1054dbcfef record: turn on showfunc
Always try to give diff context when doing an interactive record
2015-12-17 14:38:22 +00:00
timeless
2abe9172f6 histedit: omit useless message from update (edit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:04:17 +00:00
timeless
26fb25b6cd histedit: omit useless message from update (_histedit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:37:31 +00:00
timeless
5551448efc histedit: omit useless message from update (histeditaction)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 21:43:16 +00:00
timeless
0853af047a histedit: omit useless message from abort
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:08:14 +00:00
Mateusz Kwapich
dcddc82bed patch: disable nobinary when HGPLAIN=1
The diff output without binaries is definitely great for interactive users - a
binary patch is not meaningful for them. Although setting diff.nobinary flag
can break the automation. Let's force full output for automation.
2015-12-17 11:00:06 -08:00
Matt Mackall
1a6d366c07 run-tests: show scheduling with --showchannels
This gives one line of output per second with one column per -j level
that allows analyzing test scheduling problems. First 24 seconds of
output at -j 30 looks like this:

  0                                                                .
  1  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   s.
  2  c c o c r l g r s s = c p = c h c a h c g c h c b c c l l c   ss
  3  h o b o e a e u u u c o a h o e o c g o l h g h u o = a o =   s
  4  e n s n b r n n b b   m t g n l n l w n o e w e n n e r g i   .
  5  c t o = a g d - r r = m c w v p v . e v g c e c d v x g . m
  6  k r l r s e o t e e b a h e e . e . b e . k b k l e t e . p
  7  - i e e e f c e p p u n b b r . r . - r . - - - e r e f . o   .
  8  p b t v - i . s o o n d o d t . t . c t . c s = 2 t n i . r
  9  y - e s c l . t - . d - m i - . - . o - . o y r - - s l . t
 10  3 p - e h e . s s . l t b r s . s . m s . d m e f s i e . .
 11  - e c t e s . . v . e e . . v . v . m v . e r n o v o s . .
 12  c r h . c - . . n . 2 m . . n . n . a n . . e a r n n . . .
 13  o f e . k u . . . . - p . . - . - . n - . . v m m - . . . .
 14  m . c . - p . . . . e l . . s . m . d s . . . e a e . . . .
 15  p . k . r d . . . . x a . . i . o . s o . . . - t n . . . .
 16  a . h . e a . . . . c t . . n . v . . u . . . m . c . . . .
 17  t . e . s t . . . . h e . . k . e . . r . . . e . o . . . .
 18  . . a . t e . . . . a . . . . . . . . c . . . r . d . . . .
 19  . . d . o . . . . . n . . . . . . . . e . . . g . i . . . .
 20  . . s . r . . . . . g . . . . . . . . . . . . e . n . . . .
 21  . . . . e . . . . . e . . . . . . . . . . . . 2 . g . . . .
 22  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 23  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   .
 24  . . . . . . . . . . . . . . . . . . . . . . . . . = . . . .   ^C

Test names read off vertically, beginning with '='. Idle time (not
shown) appears as blank space.
2015-12-07 16:16:06 -06:00
Matt Mackall
830377c397 tests: avoid duplicate install steps in test-run-tests
At several seconds each, this is significantly slowing down the test.
2015-12-06 15:14:01 -06:00
Matt Mackall
c4ab4cefae run-tests: add more scheduling weight hints
The scheduler would like to order test execution by expected run-time,
but doesn't know much about how long a test will run. It thus uses
test size as a proxy for run-time. By tweaking these weights we can
keep CPUs more evenly busy and thus finish sooner.

In particular, this change pushes the three currently longest-running
tests closer to the beginning:

test-largefiles-update.t
test-run-tests.t
test-gendoc.t

As the largefiles test is currently the long pole of the test suite
with higher -j factors, the sooner it's started, the sooner the tests
can end.

We also up the weight on some shorter but long-running tests that
could have previously delayed completion with low -j factors by
running very close to the end.
2015-12-04 17:05:20 -06:00
Matt Mackall
8d86df8f01 run-tests: report timeouts in a less alarming fashion
Rather than report timed-out tests like this:

 ERROR: test-convert-svn-sink.t output changed
 !

..simply put a 't' rather than a '.' in the stream.
2015-12-04 14:55:10 -06:00
timeless
8e17ef3397 help: filter extension commands 2015-12-14 05:29:55 +00:00
timeless
37c2440209 test-help: tighten grep patterns
Help should output section headings, but no debug commands
2015-12-14 06:00:32 +00:00
Laurent Charignon
4309e7ad61 summary: add troubles list to the output of hg summary
This patch adds troubles information to the output of hg summary.
Example line displayed in hg summary:
unstable: 1 changeset
2015-12-14 11:19:48 -08:00
Matt Mackall
bfb407a6ed wix: add missing template 2015-12-16 17:17:12 -06:00
Matt Harbison
3be931ee49 tests: add coverage to ensure Wix tracks 'help' and 'templates' files
This would have caught the problem fixed by 47bcbe06a48d. There are
other *.wxs files that can be checked, but they appear to be more
complicated. For example, locale.wxs has what appears to be foreach
loop support, as well as variable substitution.

By checking `hg files` to determine tracked file, this is able to avoid false
failures when other junk is present in the filesystem, like *.orig files.

I can't tell if the map-cmdline.status file is not included on purpose, but I
don't see the purpose of excluding it.  The missing help files seem reasonable
for Windows.
2015-09-13 22:54:51 -04:00
Matt Harbison
8f566538f8 test-hgignore: conditionalize an illegal Windows filename 2015-12-13 15:36:20 -05:00
Gregory Szorc
aaa8195abf help: support loading sub-topics
If a sub-topic/section is requested and the main topic corresponds to
a topic with sub-topics, we now look for and return content for a
sub-topic if found.

With this patch, `hg help internals.X` now works. hgweb does not yet
render sub-topics, however.
2015-12-13 11:19:55 -08:00
Gregory Szorc
82617319e9 help: add "internals" topic
We introduce the "internals" help topic, which renders an index of
available sub-topics. The sub-topics themselves are still not
reachable via the help system.
2015-12-13 10:35:03 -08:00
Gregory Szorc
f72b4b4450 util: reimplement lrucachedict
As part of attempting to more aggressively use the existing
lrucachedict, collections.deque operations were frequently
showing up in profiling output, negating benefits of caching.

Searching the internet seems to tell me that the most efficient
way to implement an LRU cache in Python is to have a dict indexing
the cached entries and then to use a doubly linked list to track
freshness of each entry. So, this patch replaces our existing
lrucachedict with a version using such a pattern.

The recently introduced perflrucachedict command reveals the
following timings for 10,000 operations for the following cache
sizes for the existing cache:

n=4     init=0.004079 gets=0.003632 sets=0.005188 mixed=0.005402
n=8     init=0.004045 gets=0.003998 sets=0.005064 mixed=0.005328
n=16    init=0.004011 gets=0.004496 sets=0.005021 mixed=0.005555
n=32    init=0.004064 gets=0.005611 sets=0.005188 mixed=0.006189
n=64    init=0.003975 gets=0.007684 sets=0.005178 mixed=0.007245
n=128   init=0.004121 gets=0.012005 sets=0.005422 mixed=0.009471
n=256   init=0.004143 gets=0.020295 sets=0.005227 mixed=0.013612
n=512   init=0.004039 gets=0.036703 sets=0.005243 mixed=0.020685
n=1024  init=0.004193 gets=0.068142 sets=0.005251 mixed=0.033064
n=2048  init=0.004070 gets=0.133383 sets=0.005160 mixed=0.050359
n=4096  init=0.004053 gets=0.265194 sets=0.004868 mixed=0.048352
n=8192  init=0.004087 gets=0.542218 sets=0.004562 mixed=0.032753
n=16384 init=0.004106 gets=1.064055 sets=0.004179 mixed=0.020367
n=32768 init=0.004034 gets=2.097620 sets=0.004260 mixed=0.013031
n=65536 init=0.004108 gets=4.106390 sets=0.004268 mixed=0.010191

As the data shows, the existing cache's retrieval performance
diminishes linearly with cache size. (Keep in mind the microbenchmark
is testing 100% cache hit rate.)

The new cache implementation reveals the following:

n=4     init=0.006665 gets=0.006541 sets=0.005733 mixed=0.006876
n=8     init=0.006649 gets=0.006374 sets=0.005663 mixed=0.006899
n=16    init=0.006570 gets=0.006504 sets=0.005799 mixed=0.007057
n=32    init=0.006854 gets=0.006459 sets=0.005747 mixed=0.007034
n=64    init=0.006580 gets=0.006495 sets=0.005740 mixed=0.006992
n=128   init=0.006534 gets=0.006739 sets=0.005648 mixed=0.007124
n=256   init=0.006669 gets=0.006773 sets=0.005824 mixed=0.007151
n=512   init=0.006701 gets=0.007061 sets=0.006042 mixed=0.007372
n=1024  init=0.006641 gets=0.007620 sets=0.006387 mixed=0.007464
n=2048  init=0.006517 gets=0.008598 sets=0.006871 mixed=0.008077
n=4096  init=0.006720 gets=0.010933 sets=0.007854 mixed=0.008663
n=8192  init=0.007383 gets=0.015969 sets=0.010288 mixed=0.008896
n=16384 init=0.006660 gets=0.025447 sets=0.011208 mixed=0.008826
n=32768 init=0.006658 gets=0.044390 sets=0.011192 mixed=0.008943
n=65536 init=0.006836 gets=0.082736 sets=0.011151 mixed=0.008826

Let's go through the results.

The new cache takes longer to construct. ~6.6ms vs ~4.1ms. However,
this is measuring 10,000 __init__ calls, so the difference is
~0.2us/instance. We currently only create lrucachedict for manifest
instances, so this regression is not likely relevant.

The new cache is slightly slower for retrievals for cache sizes
< 1024. It's worth noting that the only existing use of lurcachedict
is in manifest.py and the default cache size is 4. This regression
is worrisome. However, for n=4, the delta is ~2.9s for 10,000 lookups,
or ~0.29us/op. Again, this is a marginal regression and likely not
relevant in the real world. Timing `hg log -p -l 100` for
mozilla-central reveals that cache lookup times are dominated by
decompression and fulltext resolution (even with lz4 manifests).

The new cache is significantly faster for retrievals at larger
capacities. Whereas the old implementation has retrieval performance
linear with cache capacity, the new cache is constant time until much
larger values. And, when it does start to increase significantly, it
is a few magnitudes faster than the current cache.

The new cache does appear to be slower for sets when capacity is large.
However, performance is similar for smaller capacities. Of course,
caches should generally be optimized for retrieval performance because
if a cache is getting more sets than gets, it doesn't really make
sense to cache. If this regression is worrisome, again, taking the
largest regression at n=65536 of ~6.9ms for 10,000 results in a
regression of ~0.68us/op. This is not significant in the grand scheme
of things.

Overall, the new cache is performant at retrievals at much larger
capacity values which makes it a generally more useful cache backend.
While there are regressions, their absolute value is extremely small.
Since we aren't using lrucachedict aggressively today, these
regressions should not be relevant. The improved scalability of
lrucachedict should enable us to more aggressively utilize
lrucachedict for more granular caching (read: higher capacity caches)
in the near future. The impetus for this patch is to establish a cache
of decompressed revlog revisions, notably manifest revisions. And since
delta chains can grow to >10,000 and cache hit rate can be high, the
improved retrieval performance of lrucachedict should be relevant.
2015-12-06 19:04:10 -08:00
Pierre-Yves David
7cae660c88 tests: move the '-hg' postfix for all style tests
We had them on 'test-check-code-hg.t' to avoid collision with the test checking
'check-code' itself. Now that this one have been rename, we can safely remove
this suffix for all of them. This get them in line with 'check-pyflakes.t'.
2015-12-05 22:49:39 -08:00
Pierre-Yves David
22f4eed389 test: rename 'check-code' own test to 'test-contrib-check-code.t'
This test (making sure the 'check-code' script run as intended) have been
confused with the test making that the mercurial code base comply with our
coding still by multiple generations of contributors.

We are moving it out of the way so that all tests starting with
'test-check' are now doing compliance testing.
2015-12-05 22:47:26 -08:00
Gregory Szorc
25c5781010 revlog: use absolute_import 2015-12-12 23:22:18 -08:00
Gregory Szorc
c66a27807d windows: use absolute_import 2015-12-12 23:19:38 -08:00
Gregory Szorc
5c29ba6835 similar: use absolute_import 2015-12-12 23:17:22 -08:00
Gregory Szorc
7b3fa04da1 util: use absolute_import 2015-12-12 23:14:08 -08:00
Gregory Szorc
5d71f3b2b9 encoding: use absolute_import 2015-12-12 22:57:48 -05:00
Yuya Nishihara
a881bac864 commandserver: use absolute_import 2015-11-24 22:58:40 +09:00
timeless
5544e4c937 tests: histedit-helpers fixbundle should not complain about no input 2015-12-14 22:21:30 +00:00
timeless
bdf1c27c7d tests: relax histedit issue4251 and issue3893 backups
I'm globbing these because some are globbed, and this pair
gets in the way of the main parts of the series.
2015-12-14 22:34:30 +00:00
Augie Fackler
0a19647501 merge: have merge.update use a matcher instead of partial fn
This is relatively rarely used functionality, but migrating this to a
matcher will make future work on narrow clones more feasible.
2015-12-14 18:54:03 -05:00
Gregory Szorc
98bb2fb083 parsers: use absolute_import 2015-12-12 13:39:29 -05:00
Gregory Szorc
3fccff1c87 osutil: use absolute_import 2015-12-12 13:46:32 -05:00
Gregory Szorc
132a5b6d98 mpatch: use absolute_import
While I was here, I removed the try..except around importing cStringIO
because cStringIO should always be importable on modern Python versions.
We already do an unconditional import in other files.
2015-12-12 13:37:56 -05:00
Gregory Szorc
d6131e9cde diffhelpers: use absolute_import 2015-12-12 13:35:41 -05:00
Gregory Szorc
38f154a7ae bdiff: use absolute_import 2015-12-12 13:34:55 -05:00
Gregory Szorc
631c25fecc base85: use absolute_import 2015-12-12 13:33:47 -05:00
Gregory Szorc
71b5e83cd8 destutil: use absolute_import 2015-12-12 13:32:25 -05:00
Gregory Szorc
06ebc04a42 obsolete: use absolute_import 2015-12-12 13:30:47 -05:00
Gregory Szorc
164cea475f contrib: ignore empty files in check-py3-compat.py 2015-12-12 13:27:31 -05:00
Matt Mackall
3bbe98aeff merge with stable 2015-12-11 17:45:19 -06:00
Pierre-Yves David
516c4fcbd3 check-commit: add a test for the patch checking script in contrib
This introduces a test for the change introduced in d1bba8f10f62.
2015-12-11 12:21:26 +00:00
Bryan O'Sullivan
484df3d610 test-hgignore.t: add tests for comments
Although support for comments in hgignore files has existed for a
while, it was previously untested.
2015-12-10 21:32:19 -08:00
timeless
65f4d64bf2 help: fix help -c/help -e/help -k
Before, hg help -c was the same as hg help, now it only shows commands.
Before, hg help -e was the same as hg help, now it only shows extensions.
Before, hg help -k crashed, now it shows all topics.
2015-12-09 05:56:54 +00:00
timeless
2d7d422638 help: call filtercmd from topicmatch
update test coverage to explicitly define when help -c should
list debug/deprecated items.
2015-12-09 19:09:35 +00:00
Laurent Charignon
2ddae732ee crecord: add dictionary to default return value of filterpatch
When committing interactively without changes, the user would get a ValueError
exception. This patch adds a dictionary to the return value of filterpatch
when there are no files to change.
2015-12-09 17:01:27 -08:00
Pierre-Yves David
c33f182029 discovery: properly filter changeset in 'peer.known' (issue4982)
The 'peer.known' call (handled at the repository level) was applying its own
manual filtering (looking at phases) instead of relying on the repoview
mechanism. This led to the discovery finding more "common" node that
'getbundle' was willing to recognised. From there, bad things happen, issue4982
is a symptom of it. While situations like described in issue4982 can still
happen because of race conditions, fixing 'peer.known' is important for
consistency in all cases.

We update the code to use 'repoview' filtering. This lead to small changes in
the tests for exchanging obsolescence marker because the discovery yields
different results.

The test affected in 'test-obsolete-changeset-exchange.t' is a test for
issue4982 getting back to its expected state.
2015-12-02 16:12:15 -08:00
Pierre-Yves David
614f88221e test: add an extra base changeset in test-obsolete.t
A fix to issue4982 (not fixed in this patch) will reinforce the filtering
during discovery. This will makes two of our test repositories appear
unrelated (because all common content is properly hidden). To avoid this, we
introduce an extra base changeset that will not get obsoleted. This affects
various test output so we put this addition in its own changeset.
2015-12-09 14:22:57 -08:00
Martin von Zweigbergk
8e7f0fdda8 merge: refuse update/merge if there are unresolved conflicts (BC)
We currently allow updating and merging (with --force) when there are
unresolved merge conflicts, as long as there is only one parent of the
working copy. Even worse, when updating to another revision
(linearly), if one of the unresolved files (including any conflict
markers in the working copy) can now be merged cleanly with the target
revision, the file becomes marked as resolved.

While we could potentially allow updates that affect only files that
are not in the set of unresolved files, that's considerably more work,
and we don't have a use case for it anyway. Instead, let's keep it
simple and refuse any merge or update (without -C) when there are
unresolved conflicts.

Note that test-merge-local.t explicitly checks for conflict markers
that get carried over on update. It's unclear if that was intentional
or not, but it seems bad enough that we should forbid it. The simplest
way of fixing the test case is to leave the conflict markers in place
and just mark the files resolved, so let's just do that for now.
2015-12-07 20:43:24 -08:00
timeless
8d2aaddeec tests: drop require slow in test-contrib-perf
* skip presleep
* use a stub mode which does not output and generally loops only once
* only use one node for perfparents
2015-12-08 07:05:37 +00:00
timeless
15faf26352 convert/svn: quiet check-config 2015-12-08 08:37:12 +00:00
timeless
98fb00321c check-config: recognize convert style documentation 2015-12-08 09:22:53 +00:00
timeless
568fd6bf86 tests: use a single repo for test-contrib-perf 2015-12-08 04:56:26 +00:00
Gregory Szorc
7a14eca3ba tests: use absolute_import in tinyproxy
Thus begins a series of adding absolute_import to a bunch of files for
Python 3 compatibility.
2015-12-06 22:20:08 -08:00
Gregory Szorc
32a26751a0 tests: use absolulte_import in test-wireproto.py 2015-12-06 22:02:39 -08:00
Gregory Szorc
6aedf6c7e9 tests: use absolute_import in test-walkrepo 2015-12-06 22:05:19 -08:00
Gregory Szorc
6700f82707 tests: use absolute_import in hgweberror.py 2015-12-06 22:27:53 -08:00
Gregory Szorc
dd5b65b197 tests: use absolute_import in hghave.py 2015-12-06 22:27:18 -08:00
Gregory Szorc
8cca557cf0 tests: use absolute_import for heredoctest.py 2015-12-06 22:26:12 -08:00
Gregory Szorc
df8d1f17a7 tests: use absolute_import in /get-with-headers.py
While I was here, I removed condition code for failure to import json.
This code was necessary to support Python < 2.6, which didn't include
the json module.
2015-12-06 22:25:41 -08:00
Gregory Szorc
a89bad72f6 tests: use absolute_import in generate-working-copy-states.py 2015-12-06 22:23:37 -08:00
Gregory Szorc
da7e434856 perf: add perflrucachedict command
It measures time to construct, perform gets, sets, or mixed mode
operations on a cache of configurable size with variable numbers of
operations.
2015-12-06 17:07:50 -08:00
Gregory Szorc
eeefc7c496 tests/filterpyflakes: use absolute_import 2015-12-06 22:22:09 -08:00
Gregory Szorc
8b09023a2c tests/fakepatchtime.py: use absolute_import 2015-12-06 22:14:39 -08:00
Gregory Szorc
2e705bc6fe tests/fakedirstatewritetime.py: use absolute_import 2015-12-06 22:13:36 -08:00
Gregory Szorc
f19396fcbe tests/dumbhttp: use absolute_import 2015-12-06 22:12:07 -08:00
Gregory Szorc
80276bbc11 tests/autodiff.py: use absolute_import 2015-12-06 22:10:10 -08:00
Gregory Szorc
430d619ce6 tests/test-ancestor: use absolute_import 2015-12-06 22:07:13 -08:00
Gregory Szorc
61de06ecc1 tests: add test for Python 3 compatibility
Python 3 is inevitable. There have been incremental movements towards
converting the code base to be Python 3 compatible. Unfortunately, we
don't have any tests that look for Python 3 compatibility. This patch
changes that.

We introduce a check-py3-compat.py script whose role is to verify
Python 3 compatibility of the files passed in. We add a test that
calls this script with all .py files from the source checkout.

The script currently only verifies that absolute_import and
print_function are used. These are the low hanging fruits for Python
compatbility. Over time, we can include more checks, including
verifying we're able to load each Python file with Python 3. You
have to start somewhere.

Accepting this patch means that all new .py files must have
absolute_import and print_function (if "print" is used) to avoid
a new warning about Python 3 incompatibility. We've already
converted several files to use absolute_import and print_function
is in the same boat, so I don't think this is such a radical
proposition.
2015-12-06 22:39:12 -08:00
Matt Mackall
0fe2dfc303 merge with stable 2015-12-07 18:06:13 -06:00
Pierre-Yves David
63cc76d3b4 ui: add a 'deprecwarn' helper to issue deprecation warnings
As discussed on the list, we are adding an official way to keep old API around
for a short time in order to help third party developer to catch up. The
deprecated API will issue developer warning (issued by default during test runs)
to warn extensions authors that they need to upgrade their code without
instantaneously breaking tool chains and normal users.

The version is passed as an explicit argument so that developer think about it
and a potential future script can automatically check for it.

This is not build as a decorator because accessing the 'ui' instance will likely
be different each time. The message is also free form because deprecated API are
replaced in a variety of ways. I'm not super happy about the final rendering of
that message, but this is a developer oriented warning and I would like to move
forward.
2015-12-05 23:05:49 -08:00
Yuya Nishihara
934b9df7b4 import-checker: tell which symbol causes "direct symbol import"
This would be sometimes useful to understand why import-checker.py complains
about it.
2015-12-06 14:28:35 +09:00
Yuya Nishihara
b16ffd4ab4 import-checker: allow absolute imports of sub modules from local packages
Before this patch, import-checker.py didn't know if a name in ImportFrom
statement are module or not. Therefore, it complained the following example
did "direct symbol import from mercurial".

  # hgext/foo.py
  from mercurial import hg

This patch reuses the dict of local modules to filter out sub-module names.
2015-12-06 14:18:19 +09:00
Martin von Zweigbergk
8efd14d515 manifest: use 't' for tree manifest flag
We currently use 'd' to indicate that a manifest entry is a
directory. Let's switch to 't', since that's not a valid hex digit and
therefore easier to spot in the raw manifest data.

This will break any existing repos with tree manifests, but it's still
an experimental feature and there are probably only a few test repos
in existence with 'd' flags.
2015-12-04 14:24:45 -08:00
Pierre-Yves David
77c16aea59 test: update the docstring of 'test-devel-warnings.t' extension
We are testing more than just locks now.
2015-12-05 23:06:03 -08:00
Gregory Szorc
e2ea48dfff ui: support declaring path push urls as sub-options
Power users often want to apply per-path configuration options. For
example, they may want to declare an alternate URL for push operations
or declare a revset of revisions to push when `hg push` is used
(as opposed to attempting to push all revisions by default).

This patch establishes the use of sub-options (config options with
":" in the name) to declare additional behavior for paths.

New sub-options are declared by using the new ``@ui.pathsuboption``
decorator. This decorator serves multiple purposes:

* Declaring which sub-options are registered
* Declaring how a sub-option maps to an attribute on ``path``
  instances (this is needed to `hg paths` can render sub-options
  and values properly)
* Validation and normalization of config options to attribute
  values
* Allows extensions to declare new sub-options without monkeypatching
* Allows extensions to overwrite built-in behavior for sub-option
  handling

As convenient as the new option registration decorator is, extensions
(and even core functionality) may still need an additional hook point
to perform finalization of path instances. For example, they may wish
to validate that multiple options/attributes aren't conflicting with
each other. This hook point could be added later, if needed.

To prove this new functionality works, we implement the "pushurl"
path sub-option. This option declares the URL that `hg push` should
use by default.

We require that "pushurl" is an actual URL. This requirement might be
controversial and could be dropped if there is opposition. However,
objectors should read the complicated code in ui.path.__init__ and
commands.push for resolving non-URL values before making a judgement.

We also don't allow #fragment in the URLs. I intend to introduce a
":pushrev" (or similar) option to define a revset to control which
revisions are pushed when "-r <rev>" isn't passed into `hg push`.
This is much more powerful than #fragment and I don't think #fragment
is useful enough to continue supporting.

The [paths] section of the "config" help page has been updated
significantly. `hg paths` has been taught to display path sub-options.

The docs mention that "default-push" is now deprecated. However, there
are several references to it that need to be cleaned up. A large part
of this is converting more consumers to the new paths API. This will
happen naturally as more path sub-options are added and more and more
components need to access them.
2015-12-05 21:11:04 -08:00
Gregory Szorc
d25e6f2fdc commands: add debugdeltachain command
We have debug commands for displaying overall revlog statistics
(debugrevlog) and for dumping a revlog index (debugindex). As part
of investigating various aspects of revlog behavior and performance,
I found it important to have an understanding of how revlog
delta chains behave in practice.

This patch implements a "debugdeltachain" command. For each revision
in a revlog, it dumps information about the delta chain. Which delta
chain it is part of, length of the delta chain, distance since base
revision, info about base revision, size of the delta chain, etc. The
generic formatting facility is used, which means we can templatize
output and get machine readable output like JSON.

This command has already uncovered some weird history in
mozilla-central I didn't know about. So I think it's valuable.
2015-12-05 23:37:46 -08:00
Gregory Szorc
0c976d1ad3 histedit: pick an appropriate base changeset by default (BC)
Previously, `hg histedit` required a revision argument specifying which
revision to use as the base for the current histedit operation. There
was an undocumented and experimental "histedit.defaultrev" option that
supported defining a single revision to be used if no argument is
passed.

Mercurial knows what changesets can be edited. And in most scenarios,
people want to edit this history of everything on the current head that
is rewritable. Making histedit do this by default and not require
an explicit argument or additional configuration is a major usability
win and will enable more people to use histedit.

This patch changes the behavior of the experimental and undocumented
"histedit.defaultrev" config option to select an appropriate base
revision by default. Comprehensive tests exercising the edge cases
in the new, somewhat complicated default revset have been added.
Surprisingly, no tests broke. I guess we were never testing the
behavior with no ANCESTOR argument (it used to fail with
"abort: histedit requires exactly one ancestor revision"). The new
behavior is much more user friendly.

The functionality for choosing the default base revision has been
moved to destutil.py, where it can easily be modified by extensions.
2015-10-24 19:56:39 +01:00
Gregory Szorc
6be2ff7286 commands.debugindexdot: use cmdutil.openrevlog()
This pattern is used for all the other debug* commands that operate
on revlogs. debugindexdot is an outlier. Make it conform.
2015-12-05 21:40:38 -08:00
Martin von Zweigbergk
7a4ad651b5 revlog: don't consider nullrev when choosing delta base
In the most complex case, we try using the incoming delta base, then
we try both parents, and then we try the previous revlog entry. If
none of these result in a good delta, we natually use the null
revision as base. However, we sometimes consider the nullrev before we
have exhausted our other options. Specifically, when both parents are
null, we use the nullrev as delta base if it produces a good delta
(according to _isgooddelta()), and we fail to try the previous revlog
entry as delta base. After e60126c6093d (addrevision: use general
delta when the incoming base delta is bad, 2015-12-01), it can also
happen for non-merge commits when the incoming delta is not good.

The Firefox repo (from many months back) shrinks a tiny bit with this
patch: from 1.855GB to 1.830GB (1.4%). The hg repo itself shrinks even
less: by less than 0.1%. There may be repos that get larger instead.

This undoes the unexplained test change in e60126c6093d.
2015-12-04 17:46:56 -08:00
Gregory Szorc
9af952ad6e wireproto: config options to disable bundle1
bundle2 is the new and preferred wire protocol format. For various
reasons, server operators may wish to force clients to use it.

One reason is performance. If a repository is stored in generaldelta,
the server must recompute deltas in order to produce the bundle1
changegroup. This can be extremely expensive. For mozilla-central,
bundle generation typically takes a few minutes. However, generating
a non-gd bundle from a generaldelta encoded mozilla-central requires
over 30 minutes of CPU! If a large repository like mozilla-central
were encoded in generaldelta and non-gd clients connected, they could
easily flood a server by cloning.

This patch gives server operators config knobs to control whether
bundle1 is allowed for push and pull operations. The default is to
support legacy bundle1 clients, making this patch backwards compatible.
2015-12-04 15:12:11 -08:00
Pierre-Yves David
756a483011 context: use a the nofsauditor when matching file in history (issue4749)
Before this change, asking for file from history (eg: 'hg cat -r 42 foo/bar')
could fail because of the current content of the working copy (eg: current
"foo" being a symlink). As the working copy state have no influence on the
content of the history, we can safely skip these checks.

The working copy context class have a different 'match'
implementation. That implementation still use the repo.auditor will
still catch symlink traversal.

I've audited all stuff calling "match" and they all go through a ctx
in a sensible way. The most unclear case was diff which still seemed
okay. You raised my paranoid level today and I double checked through
tests. They behave properly.

The odds of someone using the wrong (matching with a changectx for
operation that will eventually touch the file system) is non-zero
because you are never sure of what people will do. But I dunno if we
can fight against that. So I would not commit to "never" for "at this
level" and "in the future" if someone write especially bad code.

However, as a last defense, the vfs itself is running path auditor in
all cases outside of .hg/. So I think anything passing the 'matcher'
for buggy reason would growl at the vfs layer.
2015-12-03 13:23:46 -08:00
timeless
538843243e histedit: improve missing rule suggestion
include actual suggested text
2015-12-02 07:41:35 +00:00
Yuya Nishihara
10b6f5819b graphlog: make node symbol templatable by ui.graphnodetemplate option
New ui.graphnodetemplate option allows us to colorize a node symbol by phase
or branch,

  [ui]
  graphnodetemplate = {label('graphnode.{phase}', graphnode)}
  [color]
  graphnode.draft = yellow bold

or use a variety of unicode emoji characters, and so on. (You'll need less-481
to display non-BMP unicode character.)

  [ui]
  graphnodetemplate = {ifeq(obsolete, 'stable', graphnode, '\xf0\x9f\x92\xa9')}
2015-11-14 17:25:43 +09:00
FUJIWARA Katsunori
401c1d7800 commands: make commit acquire locks before processing (issue4368)
Before this patch, "hg commit" (process A) executes steps below:

  1. get current branch heads via 'repo.branchheads()'
     - cache 'repo.changelog'
  2. invoke 'repo.commit()'
  3. acquire wlock
     - invalidate 'repo.dirstate'
  4. access 'repo.dirstate'
     - re-read '.hg/dirstate'
     - check validity of parent revisions with 'repo.changelog'
  5. invoke 'repo.commitctx()'
  6. acquire store lock (slock)
     - invalidate 'repo.changelog'
  7. do committing
  8. release slock
  9. release wlock
 10. check new branch head (via 'cmdutil.commitstatus()')

If acquisition of wlock at (3) above waits for another "hg commit"
(process B) or so running parallelly to release wlock, process A
causes creating orphan revision, because:

  - '.hg/dirstate' refers the revision, which is newly added by
    process B, as its parent

  - but already cached 'repo.changelog' doesn't contain such revision

  - therefore, validating parents of '.hg/dirstate' at (4) above
    replaces such revision with 'nullid'

Then, process A creates "orphan" revision, of which parent is "null"
revision.

In addition to it, "created new head" may be shown at the end of
process A unintentionally, if store is updated parallelly, because
both getting branch heads (1) and checking new branch head (10) are
executed outside slock scope.

To avoid this issue, this patch makes "hg commit" acquire wlock and
slock before processing.

This patch resolves the issue between "hg commit" processes, but not
one between "hg commit" and other commands. Subsequent patches resolve
the latter.

Even after this patch, there are still corner case problems below:

  - filecache may overlook changes of '.hg/dirstate', and it causes
    similar issue (see below for detail)

    https://bz.mercurial-scm.org/show_bug.cgi?id=4368#c10

  - 3rd party extension may cause similar issue, if it directly uses
    'repo.commit()' without acquisition of wlock and slock

    This can be fixed by acquisition of slock at the beginning of
    'repo.commit()', but it seems suitable for "default" branch

    In fact, acquisition of slock itself is already introduced at
    "default" branch by ec227b188932, but acquisition is not at the
    beginning of 'repo.commit()'.

This patch also changes some tests:

  - test-fncache.t needs this tricky wrapping, to release (= forced
    failure of) wlock certainly

  - order of "hg commit" output is changed by widening scope of locks,
    because some hooks are fired after releasing wlock
2015-12-02 03:12:07 +09:00
Pierre-Yves David
18b7a437e6 addrevision: use general delta when the incoming base delta is bad
We unify the delta selection process to be a simple three options process:

- try to use the incoming delta (if lazydeltabase is on)
- try to find a suitable parents to delta against (if gd is on)
- try to delta against the tipmost revision

The first of this option that yield a valid delta will be used.

The test change in 'test-generaldelta.t' show this behavior as we use a delta
against the parent instead of a full delta when the incoming delta is not
suitable.

This as some impact on 'test-bundle.t' because a delta somewhere changes. It
does not seems to change the test semantic and have been ignored.
2015-12-01 16:15:59 -08:00
Pierre-Yves David
7661a6820b test: use a bigger manifest in general delta test
The currently used manifest is too small and cannot sustain a chain length
above "1".  This make testing the 'lazybasedelta' behavior hard. So we add an
extra file in the manifest to help testing in the next changeset.

The semantic of existing tests have been checked and is not changed.
2015-12-01 18:11:00 -08:00
Yuya Nishihara
9ed442849f hgweb: load server settings from --web-conf (issue4699)
It copies the ui before loading the webconf and passes the copied ui only
to the service. This way, the hgwebdir app can reload configs cleanly.
2015-10-31 22:50:03 +09:00
Andrew Zwicky
2b7b071ce1 extdiff: correctly handle deleted subrepositories (issue3153)
Previously, when extdiff was called on two changesets where
a subrepository had been removed, an unexpected KeyError would
be raised.

Now, the missing subrepository will be ignored.  This behavior
mirrors the behavior in diffordiffstat from cmdutil.py line
~1138-1153.  The KeyError is caught and the revision is
set to None.

try/catch of LookupError around matchmod.narrowmatcher and
sub.status is removed, as LookupError is not raised anywhere
within those methods or deeper calls.
2015-11-17 16:42:52 -06:00
Christian Delahousse
aa206df360 strip: add a --keep test related to removing files from dirstate
When strip builds the list of changedfiles to pass into dirstate.rebuild, it adds
files blindly, including those that have been removed. This tests ensures that
rebuild can handle this case.
2015-11-30 11:23:15 -08:00
Christian Delahousse
2a005d816a dirstate: change debugrebuilddirstate --minimal to use dirstate.rebuild
When debugrebuilddirstate --minimal is called, rebuilding the dirstate was done
outside of the appropriate rebuild function. This patch makes
debugrebuilddirstate use dirstate.rebuild.

This was done to allow our extension to become aware debugrebuilddirstate
--minimal
2015-11-30 11:23:15 -08:00
Christian Delahousse
d37a0e0f0e debugrebuilddirstate: added tests for --minimal flag
Added tests for debugrebuilddirstate --minimal.
2015-12-01 10:52:36 -08:00
Christian Delahousse
02e3cfd53a debugdirstate: add command to rebuildstate test to modify dirstate
Debugging the dirstate helps if you have options to add files for normal lookup
or drop them from the dirstate. This patch adds a convenience command to
test-rebuilddirstate.t to modify the dirstate. It will be used in the next patch
to write proper tests for debugrebuilddirstate --minimal
2015-12-01 11:17:14 -08:00
timeless
3d618fe024 graft: improve --continue abort message
before, if you ran hg graft --user ... --date ... --log ... revs,
and if it failed, it would suggest "hg graft --continue",
but if you did that, your --user / --date / --log options
were lost, because they were not persisted anywhere...
2015-12-02 06:33:52 +00:00
timeless
9742970292 summary: mention graft 2015-12-02 06:31:12 +00:00
timeless
787afdd271 histedit: mention histedit-last-edit.txt on abort
Users may spend a lot of effort writing histedit rules,
getting an abort without being told they can recover their work
is very frustrating.

Avoid that by telling them where to find their work.
2015-12-02 08:07:36 +00:00
Augie Fackler
e9a9cb1ce9 test-fncache: ensure lock doesn't look held to __del__
This was showing a DeprecationWarning on Python 2.6.
2015-12-01 14:44:08 -05:00
Siddharth Agarwal
106adbe75b filemerge: default regular prompts to 'leave unresolved' (BC)
It makes far more sense to leave these conflicts unresolved and kick back to
the user than to just assume that the local version be chosen. There are almost
certainly buggy scripts and applications using Mercurial in the wild that do
merges or rebases non-interactively, and then assume that if the operation
succeeded there's nothing the user needs to pay attention to.
2015-12-01 09:48:38 -08:00
Siddharth Agarwal
7382fa0a4e filemerge: add a 'leave unresolved' option to change/delete prompts
We're going to make this option the default in an upcoming patch.
2015-11-30 13:43:55 -08:00
Siddharth Agarwal
7be324f9ab filemerge: add a 'leave unresolved' option to regular prompts
'Regular' here means anything that isn't a change/delete prompt. We'll add this
option to change/delete prompts in a subsequent patch.
2015-11-30 11:17:18 -08:00
Siddharth Agarwal
807dab9ed1 filemerge: add debug output for whether this is a change/delete conflict
Just like binary and symlink conflicts, change/delete conflicts influence the
tool picked.
2015-11-25 14:25:26 -08:00
Anton Shestakov
9f284e62ca webcommands: get correct parents when comparing a removed file (issue4962)
When comparing a file that was removed at the current revision, parents used to
show grandparents instead, due to how fctx was "shifted" from the current
revision to its p1. Let's not do that.

The fix is pretty much copied from webcommands.filediff().
2015-11-28 16:02:22 +08:00
Laurent Charignon
37960d39f4 commit: add amend mode for commit -i
When I moved crecord into core, I didn't include the toggleAmend function (to
switch from commit to amend mode). I did it because it would have made it more
difficult to use record and crecord interchangably. This patch reintroduces the
amend mode for commit -i as well as two tests to verify the behavior of the
function.
2015-11-30 16:37:42 -08:00
timeless
fc1657cf34 help: make help deprecated mention the extension
before this, you got an empty list of extensions, which was unhelpful
2015-11-30 20:45:07 +00:00
Mike Edgar
35c5515acc graft: copy extra (except branch) when copying changesets 2015-11-28 04:11:38 -05:00
Mike Edgar
8d4be9cc8f rebase: propagate extra dict from rebase source changeset
This corrects extra propagation for the rebase command and the shelve command.
2015-11-28 04:11:14 -05:00
Mathias De Maré
ef88a42655 commands: add example for 'hg add' 2015-11-25 18:10:31 +01:00
Gregory Szorc
2afb6aff3e extensions: refuse to load extensions if minimum hg version not met
As the author of several 3rd party extensions, I frequently see bug
reports from users attempting to run my extension with an old version
of Mercurial that I no longer support in my extension. Oftentimes, the
extension will import just fine. But as soon as we run extsetup(),
reposetup(), or get into the guts of a wrapped function, we encounter
an exception and abort. Today, Mercurial will print a message about
extensions that don't have a "testedwith" declaring explicit
compatibility with the current version.

The existing mechanism is a good start. But it isn't as robust as I
would like. Specifically, Mercurial assumes compatibility by default.
This means extension authors must perform compatibility checking in
their extsetup() or we wait and see if we encounter an abort at
runtime. And, compatibility checking can involve a lot of code and
lots of error checking. It's a lot of effort for extension authors.

Oftentimes, extension authors know which versions of Mercurial there
extension works on and more importantly where it is broken.

This patch introduces a magic "minimumhgversion" attribute in
extensions. When found, the extension loading mechanism will compare
the declared version against the current Mercurial version. If the
extension explicitly states we require a newer Mercurial version, a
warning is printed and the extension isn't loaded beyond importing
the Python module. This causes a graceful failure while alerting
the user of the compatibility issue.

I would be receptive to the idea of making the failure more fatal.
However, care would need to be taken to not criple every hg command.
e.g. the user may use `hg config` to fix the hgrc and if we aborted
trying to run that, the user would effectively be locked out of `hg`!

A potential future improvement to this functionality would be to catch
ImportError for the extension/module and parse the source code for
"minimumhgversion = 'XXX'" and do similar checking. This way we could
give more information about why the extension failed to load.
2015-11-24 15:16:25 -08:00
timeless
7337637dd1 run-tests: add --slowtimeout and use it for slow tests 2015-11-25 00:39:05 +00:00
Siddharth Agarwal
106338a190 merge: move almost all change/delete conflicts to resolve phase (BC) (API)
We have finally laid all the groundwork to make this happen.

The only change/delete conflicts that haven't been moved are .hgsubstate
conflicts. Those are trickier to deal with and well outside the scope of this
series.

We add comprehensive testing not just for the initial selections but also for
re-resolves and all possible dirstate transitions caused by merge tools. That
testing managed to shake out several bugs in the way we were handling dirstate
transitions.

The other test changes are because we now treat change/delete conflicts as
proper merges, and increment the 'merged' counter rather than the 'updated'
counter. I believe this is the right approach here.

For third-party extensions, if they're interacting with filemerge code they
might have to deal with an absentfilectx rather than a regular filectx.

Still to come:
- add a 'leave unresolved' option to merges
- change the default for non-interactive change/delete conflicts to be 'leave
  unresolved'
- add debug output to go alongside debug outputs for binary and symlink file
  merges
2015-11-25 14:25:33 -08:00
Siddharth Agarwal
1a8c549e79 test-merge-changedelete.t: print out debugmergestate
We're going to use this to verify the merge state in upcoming patches.
2015-11-25 14:26:46 -08:00
Siddharth Agarwal
6bdb690f9a debugmergestate: print out null nodes as 'null'
This is so much easier to read than a long string of zeroes, and we're going to
have a lot more of these nodes once change/delete conflicts are part of the
merge state.
2015-11-30 10:26:37 -08:00
Siddharth Agarwal
736d7e804c test-merge-force.t: check .orig files separately
We're going to soon compare the output of all the non-orig files before and
after a resolve, and this makes that more convenient. The .orig files are
obviously going to differ between the two.
2015-11-24 15:03:00 -08:00
Siddharth Agarwal
3a27c524dc merge: add a new action type representing files to add/mark as modified
This is somewhat different from the currently existing 'a' action, for the
following case:

- dirty working copy, with file 'fa' added and 'fm' modified
- hg merge --force with a rev that neither has 'fa' nor 'fm'
- for the change/delete conflicts we pick 'changed' for both 'fa' and 'fm'.

In this case 'branchmerge' is true, but we need to distinguish between 'fa',
which should ultimately be marked added, and 'fm', which should be marked
modified.

Our current strategy is to just not touch the dirstate at all. That works for
now, but won't work once we move change/delete conflicts to the resolve phase.
In that case we may perform repeated re-resolves, some of which might mark the
file removed or remove the file from the dirstate. We'll need to re-add the
file to the dirstate, and we need to be able to figure out whether we mark the
file added or modified. That is what the new 'am' action lets us do.
2015-11-30 10:19:39 -08:00
Siddharth Agarwal
61b438932e test-merge-changedelete.t: add resolve --list output
We're going to move change/delete conflicts to the resolve phase, and the
resolve --list output is one of the things that will be important to test.
2015-11-23 13:45:56 -08:00
Siddharth Agarwal
ed293bb9ab test-merge-changedelete.t: add a file with regular merge conflicts
In upcoming patches we're going to move change/delete conflicts to the resolve
phase -- it will be important to see how regular conflicts interact with
change/delete ones.
2015-11-23 13:43:14 -08:00
Yuya Nishihara
c0b0cd8366 test-help: don't use progress extension for the test of argument parsing
The next patch will remove the progress extension completely, so we have
to pick another extension. The schemes is picked arbitrary.

This test was introduced at 57703c45ed60.
2015-11-27 23:10:48 +09:00
timeless
9b03525e5c hghave.py: fix matchoutput documentation 2015-11-24 22:31:56 +00:00
timeless
dd810884fd test-contrib-perf: add smoke tests for perf.py 2015-11-24 21:41:12 +00:00
timeless
90609ddfb2 hghave.py: remove execute bit 2015-11-24 22:26:43 +00:00
Siddharth Agarwal
51f583c35b shelve: use colon instead of quotes in 'changes to' description
If detailed conflict markers are enabled and the closing quote gets truncated,
editors will often screw syntax highlighting up from that point because they'll
see an opening quote and think it's the beginning of a string.

In tests, the hashes change because the commit messages of the shelved bundles
also change.
2015-11-22 21:40:23 -08:00
Mateusz Kwapich
60093bd539 histedit: add an experimental base action
This is a first (very simple) version of the histedit base action.
It works well in common usecases like rebasing the whole stack and
spliting the stack.

I don't see any obvious edge cases - but probably there is more than one.
That's why I want to keep it behind experimental.histeditng config knob
for now. I think on knob for all new histedit behaviors is better because
we will test all of them together and testers will need to turn it on only
once to get all new nice things.
2015-11-17 15:04:31 -08:00
Mateusz Kwapich
45af8348f7 histedit: make verification configurable
Before we can add a 'base' action to histedit need to change verification
so that action can specify which steps of verification should run for it.

Also it's everything we need for the exec and stop actions implementation.

I thought about baking verification into each histedit action (so each
of them is responsible for verifying its constraints) but it felt wrong
because:
 - every action would need to know its context (eg. the list of all other
   actions)
 - a lot of duplicated work will be added - each action will iterate through
   all others
 - the steps of the verification would need to be extracted and named anyway
   in order to be reused

The verifyrules function grows too big now. I plan to refator it in one of
the next series.
2015-11-17 16:37:26 -08:00
Anton Shestakov
5c74a8a582 paper: show current revision on file log page
Most of the pages in paper (and coal) style show the current revision and its
branch, tags and bookmarks. Let's also show all this on file log page.
2015-11-13 18:31:58 +08:00
Matt Harbison
ea3de44e49 test-resolve: fix '--tool f' invocation for Windows
Windows can't invoke a python script directly, so invoke sh.exe instead.

According to sid0, the output changes are due to the fact that 'f' is no longer
being passed all of the args that it was, but these changes aren't essential to
the test [1].

[1] https://selenic.com/pipermail/mercurial-devel/2015-November/075768.html
2015-11-22 21:20:08 -05:00
Matt Harbison
2c0c2470a4 test-histedit: $TESTTMP quoting fixes for Windows
Without this, C:\path\to\test is converted into C:pathtotest.

Since $TESTTMP appears in output, seems to work in some places without quotes,
and is also used within a larger quote block (see test-rebase-collapse.t, ~line
160), I'm not sure what a check-code rule would look like (or even if it is
feasible).
2015-11-22 13:05:21 -05:00
Matt Harbison
bf40666b90 test-run-tests: conditionalize the $TESTDIR check for Windows separator
The variable uniformly uses '\' separators, so the straight equality check with
'/' separating the last component fails.  It also doesn't like having the quote
appear in the middle of the string when testing.
2015-11-16 16:56:00 -05:00
Matt Harbison
8637ab634c test-context: conditionalize the workingfilectx date printing for Windows
Starting with 8102a3981272, the output changed on Windows:

  --- e:/Projects/hg/tests/test-context.py.out
  +++ e:/Projects/hg/tests/test-context.py.err
  @@ -1,4 +1,4 @@
  -workingfilectx.date = (1000, 0)
  +workingfilectx.date = (1000L, 0)
   ASCII   : Gr?ezi!
   Latin-1 : Grⁿezi!
   UTF-8   : Gr├╝ezi!

Since int and long are both 32 bit on Windows, this seems harmless in practice
other than the previous test failure.
2015-11-09 17:15:36 -05:00
Matt Harbison
89239f0372 test-mq-qrefresh: drop single quoting of HGEDITOR value for Windows
This was failing with:

    sh: $TESTTMP/checkvisibility.sh: No such file or directory
2015-11-16 14:37:03 -05:00
Matt Harbison
446c297580 test-import: don't use printf to append an extension to $HGRCPATH
The extension was failing to load on Windows because $TESTTMP contains a path
component 'test', prefixed by a path separator '\'.  That combination ends up
converted to "...<tab>est...".
2015-11-16 14:12:27 -05:00
Matt Harbison
66fa6febb4 test-ssh: stop quoting dummyssh invocation for Windows
The other invocations aren't quoted, and Windows doesn't like the single quotes:

  diff --git a/tests/test-ssh.t b/tests/test-ssh.t
  --- a/tests/test-ssh.t
  +++ b/tests/test-ssh.t
  @@ -520,20 +520,8 @@ remote hook failure is attributed to rem
     $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc

     $ hg -q --config ui.ssh="python '$TESTDIR/dummyssh'" clone ssh://user@dummy/remote hookout
  +  abort: no suitable response from remote hg!
  +  [255]
     $ cd hookout
  +  $TESTTMP.sh: line 264: cd: hookout: No such file or directory
     $ touch hookfailure
  -  $ hg -q commit -A -m 'remote hook failure'
  ....
2015-11-16 13:44:27 -05:00
Shubhanshu Agrawal
caf17cd48e strip: changing bookmark argument to be a list
Currently strip works with a single bookmark,
the changes in this patch modifies the strip
extension to accept a list of bookmarks
2015-11-19 12:50:10 +05:30
Siddharth Agarwal
4a78a436f9 mergestate: handle additional record types specially
This works around a bug in older Mercurial versions' handling of the v2 merge
state.

We also add a bunch of tests that make sure that
(1) we correctly abort when the merge state has an unsupported record type
(2) aborting the merge, rebase or histedit continues to work and clears out the
    merge state.
2015-11-18 15:46:45 -08:00
Siddharth Agarwal
d523c7a52e test-resolve.t: remove completely unnecessary line
I have no idea what I was thinking when I wrote this.
2015-11-18 23:42:32 -08:00
liscju
616740cead fileset: add missing() predicate (issue4925)
Help of status cmd defines status file of 'missing', what is
called in fileset 'deleted'. To stay consistent this patch
introduces missing() predicate which in fact is alias to
'deleted'.
2015-11-18 20:55:32 +01:00
Siddharth Agarwal
ad963d1bec unshelve: add support for custom merge tools
For parity with merge --tool, rebase --tool etc.

rebase.rebase overwrites the tool in repo.ui, so we need to explicitly pass it
down there too.
2015-11-18 15:11:23 -08:00
Siddharth Agarwal
a77766bbfd unshelve: add -k as short form of --keep
For parity with strip -k, rebase -k, etc.
2015-11-18 15:04:03 -08:00
Laurent Charignon
e24d860326 rebase: don't rebase obsolete commits with no successor
This patch avoids unnecessary conflicts to resolve during rebase for the users
of changeset evolution.

This patch modifies rebase to skip obsolete commits with no successor.
It introduces a new rebase state 'revpruned' for these revisions that are
being skipped and a new message to inform the user of what is happening.
This feature is gated behind the config flag experimental.rebaseskipobsolete

When an obsolete commit is skipped, the output is:
note: not rebasing 7:360bbaa7d3ce "O", it has no successor
2015-11-18 13:44:29 -08:00
Laurent Charignon
3bbe7ac5d7 rebase: fix a typo in test-rebase-obsolete
We had left a lonely single quote where it shouldn't be!
2015-11-18 13:46:42 -08:00
Matt Mackall
a20ef0162d merge with stable 2015-11-18 20:59:17 -06:00
Christian Delahousse
98bab4b18b convert: changed test's progress output format to ignore estimate
On my machine, whenever I run all test with a high -j value, test-convert-git.t
would consistently fail by displaying an estimate. This patch removes that value
from the output.
2015-11-17 18:01:21 -08:00
Laurent Charignon
85b8e6613d localrepo: put bookmark move following commit in one transaction
Before this patch, making a commit on a local repo could move a bookmark and
both operations would not be grouped as one transaction. This patch makes both
operations part of one transaction. This is necessary to switch to the new api
to save bookmarks repo._bookmarks.recordchange if we don't want to change the
current behavior of rollback.

Dirstate change happening after the commit is done is now part of the
transaction mentioned above. This leads to a change in the expected output of
several tests.

The change to test-fncache happens because both lock are now released in the
same finally clause. The lock release is made explicitly buggy in this test.
Previously releasing lock would crash triggering release of wlock that crashes
too. Now lock release crash does not directly result in the release of wlock.
Instead wlock is released at garbage collection time and the error raised at
that time "confuses" python.
2015-11-18 01:36:58 -08:00
Siddharth Agarwal
dbd338edf0 test-resolve.t: switch to mergestate.read()
See previous patches for why we're doing this.
2015-11-17 15:43:21 -08:00
Siddharth Agarwal
c7aefbc8d6 debugmergestate: print out record type for files
We're going to add a separate record type for change/delete conflicts soon. We
need to make sure they get stored with the correct record type so that older
versions of Mercurial correctly abort when they see change/delete records.
2015-11-13 23:01:36 -08:00
Yuya Nishihara
b20edef8a1 templater: move label() function from color extension
ui.label() is no-op by default, so we can just call ui.label() by label()
template function no matter if the color is enabled or not.
2015-06-11 23:04:14 +09:00
Yuya Nishihara
e7ec9f2344 templater: make label() take unknown symbol as color literal
Instead of the mapping hack introduced by d4686e0c15c9, this patch changes the
way how a label symbol is evaluated. This is still hackish, but should be more
predictable in that it doesn't depend on the known color effects.

This change is intended to eliminate the reference to color._effects so that
color.templatelabel() can be merged with templater.label().
2015-06-11 22:58:27 +09:00
timeless
6a754bf667 convert: monotone use absolute_import 2016-03-02 15:50:34 +00:00
timeless
d22428de9f convert: p4 use absolute_import 2016-03-02 15:31:15 +00:00
timeless
9b1f5043ce convert: hg use absolute_import 2016-03-02 15:26:49 +00:00
timeless
de2d02e8b7 convert: cvsps use absolute_import 2016-03-02 14:56:29 +00:00
timeless
96ac5cd883 convert: darcs use absolute_import 2016-03-02 14:23:23 +00:00
timeless
86b7c93478 convert: filemap use absolute_import 2016-03-02 09:00:58 +00:00
timeless
81c64e649e convert: gnuarch use absolute_import 2016-03-02 08:58:01 +00:00
timeless
65e468cce9 convert: git use absolute_import 2016-03-02 20:42:13 +00:00
timeless
ec454c0097 commit: block amend while histedit is in progress (issue4800) 2016-02-14 07:35:50 +00:00