Commit Graph

23765 Commits

Author SHA1 Message Date
Eric Sumner
e2ad8ed688 repair: add experimental option to write bundle2 files
This adds an experimental option 'strip-bundle2-version' which causes backup
bundles to use bundle2 formatting.  Especially for generaldelta repositories,
this should provide significant performance gains for any operation that needs
to write a backup.
2015-01-15 16:51:13 -08:00
Eric Sumner
dab488d66f changegroup.getsubset: support multiple versions
Allow a version parameter to specify which version of the packer should be
used
2015-01-15 15:55:13 -08:00
Eric Sumner
96fb8b0c04 changegroup.writebundle: HG2Y support
This diff adds support to writebundle to generate a bundle2 wrapper; upcoming
diffs will add an option to write a v2 changegroup part instead of v1 in these
bundles.
2015-01-15 15:39:16 -08:00
Eric Sumner
7cbcf9bdca changegroup.writebundle: provide ui
The next diff will add support for writing bundle2 files to writebundle, but
the bundle2 generator wants access to a ui object.  This changes the signature
and callsites to pass one in.
2015-01-15 14:39:41 -08:00
Matt Mackall
c031f45352 test-module-imports: use test-repo requirement 2015-01-16 16:25:30 -08:00
Mads Kiilerich
645e139353 largefiles: don't rehash largefiles in updatelfiles if standin hash changed
Standins are read before and after an update/merge, and all the standins that
changes are handed to updatelfiles for getting their corresponding largefiles
updated. updatelfiles would then hash the largefile and see if it already
matched the new expected hash. If so, it would skip the update. If different,
the largefile would be updated.

It would happen very rarely that the largefile happened to match the new hash
(and thus not the old one) and the hashing would thus be pointless ... and
hashing is not cheap.

Instead, when it is known that the standin hash changed (from an update), just
update the standin unconditionally. If the largefile was "unsure" before the
update, it was hashed at that point, so we know there is nothing to preserve.
(Also, the hashing in updatelfiles was not used to preserve changes, but only
to be lazy about updating the largefile, so nothing is lost by not doing this
extra hashing.)

There might be rare situations where we now will update largefiles that didn't
have to be updated, but in all relevant cases (?) this will improve
performance.

Updates on a repo with some big largefiles has been seen to go from 9.19 s to
6.8 s - that is 26% less painful.
2015-01-09 19:10:09 +01:00
Mads Kiilerich
f30992016d largefiles: show progress when checking standin hashes in outgoing changesets
This checking can take a huge amount of time and we should give user a hint
that something is going on.
2015-01-16 19:51:25 +01:00
Eric Sumner
9e907c2f00 unbundle: support bundle2 files
This adds support for bundle2 files to the unbundle command.
2015-01-14 17:09:55 -08:00
Eric Sumner
c5cdff3779 pullbundle2: extract addchangegroup result combining into its own function
This will also be used for 'hg unbundle'
2015-01-16 12:53:45 -08:00
Augie Fackler
e6db2587ea histedit: add a test to show that issue4251 is fixed (issue4251)
This will help us not regress this case in the future.
2015-01-16 15:31:45 -05:00
Eric Sumner
676662b804 commands.debugbundle: bundle2 support
This enables debugbundle to print supporting info for bundle2 files.
2015-01-15 15:35:26 -08:00
Matt Harbison
881cca26a2 largefiles: cleanup overrideadd()
This was a remnant of the code prior to overridding cmdutil.add().
2015-01-12 22:30:12 -05:00
Matt Harbison
2785c0c1da largefiles: enable subrepo support for add
The --large, --normal and --lfsize args couldn't be passed to a subrepo before,
and files in the subrepos would be added silently (if -v wasn't specified) as
normal files.  As an added bonus, 'hg add --dry-run' no longer prints that
largefiles would also be added as normal files as well.
2015-01-12 21:44:43 -05:00
Matt Harbison
8fad1493fa add: pass options via keyword args
The largefiles extensions needs to be able to pass --large, --normal and
--lfsize to subrepos via cmdutil.add() and hgsubrepo.add().  Rather than add
additional special purpose arguments, stop extracting the existing args from the
**opts passed to commands.add() and just pass them along.
2015-01-12 20:59:17 -05:00
Matt Harbison
c849805e2f largefiles: don't pop largefile-specific arguments to the add command
The arguments will need to stay present when making add work with subrepos.
2014-12-31 18:24:32 -05:00
Angel Ezquerra
79a2fd145f share: replace the bookmarks.shared file with an entry on a new "shared" file
0e5f75a52c9d introduced a way to share bookmarks. When a repository share that
shares bookmarks was created, a .hg/bookmarks.shared file was created to mark
the repository share as one that shares its bookmarks.

We have plans to introduce other levels of sharing, including a "full share"
mode. Rather than creating a new ".shared" file for each new thing that we may
want to share It seems better to create a single "shared" file that will list
what is shared for a given shared repository. This should make it much easier
to get a list of everything that is shared by a given shared repository.

The shared file contains a list of shared "items" (such as bookmarks). Each
shared "item" is added as a new line in the file. For now the only possible
entry in the file is "bookmarks".
2015-01-11 16:20:15 +01:00
Mads Kiilerich
e8c3de8b41 docker: support Fedora 21 2014-11-02 02:36:47 +01:00
Mads Kiilerich
a678d2511e rpm: make Python 2.7.9 the default Python to include in rpms for EL 5
Use the new and more TLS support in Python 2.7.9.
2015-01-16 04:26:40 +01:00
Mads Kiilerich
bb43dcc3a8 contrib: make Python 2.7.9 the default in Makefile.python
We should utilize (and test) the big API changes and new TLS functionality in
Python 2.7.9 whenever possible.
2015-01-16 04:26:25 +01:00
Angel Ezquerra
79698da278 localrepo: remove all external users of localrepo.wopener
This change touches every module in which repository.wopener was being used, and
changes it for the equivalent repository.wvfs.

It should now be possible to remove localrepo.wopener.
2015-01-11 01:51:52 +01:00
Angel Ezquerra
6e49f7def8 localrepo: remove all external users of localrepo.sopener
This change touches every module in which repository.sopener was being used, and
changes it for the equivalent repository.svfs.

It should now be possible to remove localrepo.sopener.
2015-01-11 00:25:54 +01:00
Angel Ezquerra
88cbab7845 localrepo: remove all external users of localrepo.opener
This change touches every module in which repository.opener was being used, and
changes it for the equivalent repository.vfs. This is meant to make it easier
to split the repository.vfs into several separate vfs.

It should now be possible to remove localrepo.opener.
2015-01-15 23:17:12 +01:00
Sean Farley
a6610c70d3 log: use namespace logname and colorname
Now that we have the machinary to change the log name and the color label used,
let's use that. Tests have been updated accordingly.
2015-01-14 20:29:47 -08:00
Sean Farley
8f432b351e namespaces: add colorname member to namespace object
Previously, there was no way to change the color label used for 'hg log'
output. This patch just adds the member to the object, a future patch will
change 'hg log' to use this.
2015-01-14 20:11:02 -08:00
Sean Farley
899d50e422 namespaces: add logname member to namespace object
Previously, there was no way to change the name used for 'hg log' output. This
was inconvenient for extensions that want a template name longer than 12
characters (e.g. remotebookmarks) but a different name for 'hg log'.

This patch only adds the member to the object, a future patch will update the
'hg log' code.
2015-01-14 20:06:44 -08:00
Sean Farley
6acd704926 namespaces: use named args for namespace api
This is just a style change but makes adding new arguments more robust for
callers.
2015-01-14 19:55:20 -08:00
Sean Farley
fe60a42bd6 namespaces: make the constructor into named args
None of the arguments are truly optional but this makes adding future arguments
more robust and perhaps optional.
2015-01-14 19:39:13 -08:00
Gregory Szorc
28755d2e9a dispatch: only check compatibility against major and minor versions (BC)
Extensions can declare compatibility with Mercurial versions. If an
error occurs, Mercurial will attempt to pin blame on an extension that
isn't marked as compatible.

While all bets are off when it comes to the internal API, my experience
has shown that a monthly/patch release of Mercurial has never broken any
of the extensions I've written. I think that expecting extensions to
declare compatibility with every patch release of Mercurial is asking a
bit much and adds little to no value.

This patch changes the blame logic from exact version matching to only
match on the major and minor Mercurial versions. This means that
extensions only need to mark themselves as compatible with the major,
quarterly releases and not the monthly ones in order to stay current and
avoid what is almost certainly unfair blame. This will mean less work
for extension authors and almost certainly fewer false positives in the
blame attribution.
2015-01-15 20:36:03 -08:00
Gregory Szorc
bd697301fe test-extension: use a realistic Mercurial version
Mercurial doesn't define the 3rd "patch" version field for major
releases. Don't use it in tests.
2015-01-15 20:03:48 -08:00
Gregory Szorc
db026aaaab test-extension: improve test readability
There was a mountain of text in this file that made reading the tests
difficult. Inserting some line breaks greatly improves the situation.
2015-01-15 19:47:06 -08:00
Pierre-Yves David
3256dbc9b3 bundle2: enforce parttype as alphanumerical
The binary format description has always stated that the parttype should be simple,
but it was never really enforced. Recent discussions have convinced me we want to
keep the part type simple and easy to debug. There is enough extensibility in
the rest of the format.
2014-12-18 19:14:01 -08:00
Matt Harbison
07fa08825f tests: conditionalize test-tools.t for Windows support
I still get the following diff on Windows 7 with NTFS.  I'm not sure if it is
expected and we should wildcard the link count, or if something needs to be
fixed.

  @@ -58,7 +58,7 @@

     $ ln bar baz
     $ f bar -n baz -l --hexdump -t --sha1 --lines=9 -B 20
  -  bar: file, links=2, newer than baz, sha1=612ca68d0305c821750a
  +  bar: file, links=0, newer than baz, sha1=612ca68d0305c821750a\r (esc)
     0000: 31 0a 32 0a 33 0a 34 0a 35 0a 36 0a 37 0a 38 0a |1.2.3.4.5.6.7.8.|
     0010: 39 0a                                           |9.|
2015-01-14 22:40:39 -05:00
Mads Kiilerich
3c0558f97b dirstate: ignore negative debug.dirstate.delaywrite values - they crashed it
Sleep can only travel forward in time, not back.
2015-01-14 01:15:26 +01:00
Pierre-Yves David
dc490d9ff6 linkrev: use the right manifest content when adjusting linrev (issue4499)
When the manifest revision is stored as a delta against a non-parent revision,
'_adjustlinkrev' could miss some file update because it was using the delta
only. We now use the 'fastread' method that uses the delta only when it makes
sense.

A test showcasing on the of possible issue have been added.
2015-01-14 17:21:09 -08:00
Matt Mackall
4accabb1fb unpacker: fix missing arg for py2.4 2015-01-14 16:57:00 -08:00
Mads Kiilerich
bc7c34a53f branchcache: make _rbcrevslen handling more safe
self._rbcrevslen is used to keep track of the number of good records on disk.
It should thus not be updated before the records actually have been written to
disk.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
49a09d3e6c branchcache: add debug output whenever cache files use truncate
The cache files are usually append only but will automatically be truncated and
recover in exceptional situations. Add a debug notice when such exceptional
situations are encountered.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
af5557983d tests: rework revision branch cache tests
The tests that were added with the revision branch cache in 6aa81b0c4658 had
suffered from bit rot in the development iterations. They were no longer that
"good".

Now, the tests are rewritten and reworked to be more readable and maintainable
and relevant for the actual implementation.

This also utilizes the new 'f' helper tool for keeping an eye the cache files.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
de81c27e94 tests: add 'f' tool for cross platform file operations in the tests
This tool is like the collection of tools found in a unix environment but are
cross platform and stable and suitable for our needs in the test suite.

The main reason it is "needed" now is for hexdump of revision branch cache to
keep an eye on how it changes and make sure the format is stable.

It is a very generic tool that can end up being used a lot in tests, so I gave
it very generic name.
2015-01-14 01:15:26 +01:00
Mads Kiilerich
9f07fbbb15 run-tests: include testdir in $PATH so tests easily can use helper tools
The testdir is already added to $PYTHONPATH - I think it makes sense and is
convenient to add it to $PATH too.

The following binaries are invoked from tests using full path with $TESTDIR/ -
they can now be used without specifying path:
  dumbhttp.py
  dummyssh
  filterpyflakes.py
  generate-working-copy-states.py
  get-with-headers.py
  hghave
  histedit-helpers.sh
  killdaemons.py
  md5sum.py
  notcapable
  printenv.py
  readlink.py
  revlog-formatv0.py
  run-tests.py
  svn-safe-append.py
  svnxml.py
  tinyproxy.py
2015-01-14 01:15:26 +01:00
Mike Edgar
3136b352b8 filelog: use censored revlog flag bit to quickly check if a node is censored 2015-01-12 15:29:36 -05:00
Mike Edgar
39ea63d3f6 revlog: verify censored flag when hashing added revision fulltext
When receiving a delta via exchange, three possible storage outcomes emerge:

1. The delta is added directly to the revlog. ("fast-path")
2. A freshly-computed delta with a different base is stored.
3. The new revision's fulltext is computed and stored outright.

Both (2) and (3) require materializing the full text of the new revision by
applying the delta to its base. This is typically followed by a hash check.

The new flags argument allows callers to _addrevision to signal that they
expect that hash check to fail. We can use this opportunity to verify that
expectation. If the hash fails, require the flag be set; if the hash passes,
require the flag be unset.

Rather than simply eliding the hash check, this approach provides some
assurance that the censored flag is not applied to valid revisions.

Read more at: http://mercurial.selenic.com/wiki/CensorPlan
2015-01-12 14:41:25 -05:00
Mike Edgar
4b3ca8d71c revlog: add flags argument to _addrevision, update callers use default flags
For revlog index flags to be useful to other parts of Mercurial, they need to
be settable when writing revisions. The current use case for revlog index
flags is the censorship feature: http://mercurial.selenic.com/wiki/CensorPlan

While the censor flag could be inferred in _addrevision by interrogating the
text/delta being added, that would bury the censorship logic and
inappropriately couple it to all revision creation.
2015-01-12 14:30:24 -05:00
Mike Edgar
339a2739c2 revlog: define censored flag for revlogng index
This flag bit will be used to cheaply signal censorship presence to upper
layers (exchange, verify). It indicates that censorship metadata is present
but does not attest to the verifiability of that metadata.

For the censorship design, see: http://mercurial.selenic.com/wiki/CensorPlan
2015-01-12 14:01:52 -05:00
Angel Ezquerra
31175ea75d localrepo: remove all internal uses of localrepo.wopener
It has been replaced with localrepo.wvfs.
2015-01-11 01:32:36 +01:00
Angel Ezquerra
0a17f36bbf localrepo: remove all internal uses of localrepo.sopener
It has been replaced with localrepo.svfs.
2015-01-11 00:21:58 +01:00
Angel Ezquerra
76ceda0ebf localrepo: remove all internal uses of localrepo.opener
It has been replaced with localrepo.vfs. In the future we may split the vfs into
different vfs objects to access different elements of the repository.
2015-01-10 23:02:52 +01:00
Augie Fackler
49db56dd00 sslutil: drop defunct ssl version constants
Nobody outside sslutil should be using these constants anyway.
2015-01-14 15:46:21 -05:00
Augie Fackler
b7dd73bb3d sslutil: use saner TLS settings on Python 2.7.9
Asking for TLSv1 locks us out of TLSv1_2 etc. This is at least less
bad. Ideally we'd use ssl.create_default_context(), but that causes
more mayhem in the testsuite than I really want to deal with right
now.
2015-01-14 15:46:00 -05:00
Augie Fackler
9eebaa8a72 sslutil: drop support for clients of sslutil specifying a TLS version
We really just want to support the newest thing possible, so we may as
well consolidate that knowledge into this module. Right now this
doesn't change any behavior, but a future change will fix the defaults
for Python 2.7.9 so we can use slightly better defaults there (which
is the only place it's possible at the moment.)
2015-01-14 15:31:16 -05:00