Commit Graph

11536 Commits

Author SHA1 Message Date
Sean Farley
8901e63f4c memctx: remove ignored since it is now inherited 2014-05-28 20:03:29 -05:00
Sean Farley
72ed48fbf9 memctx: remove unknown since it is now inherited 2014-05-28 20:03:19 -05:00
Sean Farley
10ff60a8f2 memctx: remove deleted since it is now inherited 2013-08-15 15:13:14 -05:00
Sean Farley
06fb032978 memctx: remove removed since it is now inherited 2013-08-15 15:12:54 -05:00
Sean Farley
a5e383250e memctx: remove added since it is now inherited 2013-08-15 15:12:46 -05:00
Sean Farley
e1a50e2392 memctx: remove modified since it is now inherited 2013-08-15 15:12:31 -05:00
Sean Farley
3bb2b1b835 memctx: remove files since it is now inherited
This is a slight change in definition from memctx returning only modified() but
its parent's definition is more consistent with other contexts' behavior so we
can call this change a slight bugfix and step in the right direction.
2013-08-15 15:12:19 -05:00
Sean Farley
ff84134188 memctx: remove description since it is now inherited 2013-08-15 15:07:43 -05:00
Sean Farley
e20bb1e948 memctx: remove date since it is now inherited 2013-08-15 15:07:29 -05:00
Sean Farley
24ca8e9461 memctx: remove user since it is now inherited 2013-08-15 15:07:01 -05:00
Sean Farley
ef4723d1a0 memctx: remove p2 since it is now inherited 2013-08-15 15:06:39 -05:00
Sean Farley
ee101eac61 memctx: remove p1 since it is now inherited 2013-08-15 15:06:10 -05:00
Sean Farley
9609b1d01c memctx: remove __getitem__ since it is now inherited 2013-08-15 15:05:32 -05:00
Sean Farley
f9b7d78d04 memctx: remove __nonzero__ since it is now inherited 2013-08-15 15:04:55 -05:00
Sean Farley
4a1f5fc163 memctx: remove __int__ since it is now inherited 2013-08-15 15:04:36 -05:00
Sean Farley
a6facf0d7d memctx: remove __str__ since it is now inherited 2013-08-15 15:03:52 -05:00
Sean Farley
f37d45d609 memctx: call super.__init__ instead of duplicating code 2013-08-15 15:03:03 -05:00
Sean Farley
2b69f12f63 memctx: inherit from committablectx
This patch marks the start of having memctx inherit from committablectx,
thereby making it a full-fledged context that will eventually grow the ability
to perform diffing and also merging.
2013-08-15 15:00:03 -05:00
Sean Farley
f1efbc42f4 committablectx: fix _manifest doc string 2014-04-29 16:49:27 -05:00
Sean Farley
91eeee166f context: fix wrong indentation from renaming method 2014-05-29 16:09:16 -05:00
Pierre-Yves David
b483678287 push: use bundle2 to push phases when available
We now use a bundle2 container to push all phase updates at the same time. This
is a significant step forward, even if further refactoring is needed to unify
phase push with the changeset push.
2014-05-27 16:33:06 -07:00
Pierre-Yves David
c961ed1664 pushkey: add an `encode` function
This function is just a shorthand for ``encoding.fromlocal``. It will help
hiding the encoding business from other code exchanging pushkey data over the
wire.
2014-05-29 15:22:58 -07:00
Pierre-Yves David
f7baff1111 bundle2: add `pushkey` support
After ``listkeys`` we can now include ``pushkey`` request in a bundle2. The part
uses a very simple scheme closest as possible to the current wireproto command
for ``pushkey``. We may eventually decide for a more sophisticated part format
before the protocol becomes final.
2014-05-27 16:32:50 -07:00
Pierre-Yves David
97316a2345 pushkey: add a `decode` function
This function is just a shorthand for ``decoding.fromlocal``. It will help
hiding the encoding business from other code exchanging pushkey data over the
wire.
2014-05-29 15:23:25 -07:00
Pierre-Yves David
6a6d38b1b8 pull: when remote supports it, pull phase data alongside changesets
We use bundle2 to retrieve the remote phase data at the same time as
changesets. This reduces the amount of requestis and should improve consistency
as the server can ensure nothing changed between the retrieval of those parts.
2014-05-27 15:44:46 -07:00
Pierre-Yves David
deb72642b3 getbundle: support of listkeys argument when bundle2 is used
A new ``listkeys`` is supported by getbundle. It is a list of namespaces whose
content should be included in the bundle.

An appropriate entry has been added to the wireproto map of getbundle arguments
and a new bundle2 capability is advertised.

There are still no codes that request such parts in core mercurial.
2014-05-27 15:43:09 -07:00
Pierre-Yves David
a14e2297f0 getbundle: raise error if extra arguments are provided for bundle10
New arguments are most likely to be supported by bundle20 (and above) only.
2014-05-29 14:59:22 -07:00
Pierre-Yves David
c4d12e35a5 bundle: introduce a listkey handler
This makes it possible to handle listkeys-related data stored in a bundle2.
There are no producers yet.
2014-05-27 15:42:03 -07:00
Pierre-Yves David
57230c6e44 pull: split remote phases retrieval from actual application
We want to be able to retrieve phases information through bundle2. The logic to
apply remote phases will not change.
2014-05-27 15:29:08 -07:00
Pierre-Yves David
9ddf331cd4 wireproto: use pushkey.decodekey 2014-05-27 15:02:51 -07:00
Pierre-Yves David
1ff0f40ae5 pushkey: introduce an `decodekeys` function
This function provides a standardized way to exchange pushkey content over
the wire.
2014-05-27 15:00:20 -07:00
Pierre-Yves David
3b4a115178 wireproto: use pushkey.encodekey 2014-05-27 15:00:08 -07:00
Pierre-Yves David
80d71a6ab3 pushkey: introduce an `encodekeys` function
This function provides a standardized way to exchange pushkey content over
the wire.
2014-05-27 14:57:28 -07:00
Pierre-Yves David
95482f20ff getbundle: declare type of parameters
In addition to listing the expected options for ``getbundle``, we also list their
types and handle the encoding/decoding automatically. This should make it easier
for extensions to transmit additional information to getbundle.
2014-05-22 09:53:52 -07:00
Pierre-Yves David
8174979f47 bundle2: introduce a `caps20to10` function
This function factors the creation of appropriate entries to use in
``bundlecaps`` argument of ``getbundle``. This cleans up code calling
``getbundle`` and helps its usage in more part of the code.
2014-05-22 13:31:33 -07:00
Pierre-Yves David
c2721b6512 bundle2: introduce a bundle2caps function
The process of decoding remote bundle2caps blob into a dictionary is cumbersome.
We move it into a small helper function. This will clarify code that reads
bundle2 capabilities of peers and helps using it in new places.
2014-05-24 16:20:09 -07:00
Pierre-Yves David
ad6efcd2be exchange: reinsert comment in the right place
Unrelated new code was inserted between the original comment and the related
code block.
2014-05-22 12:58:07 -07:00
Matt Mackall
ba031d2d3b merge with stable 2014-05-29 15:41:16 -07:00
Pierre-Yves David
5877b7bbef wireproto: expose the list of getbundle arguments to extensions
For now, getbundle accepts a fixed number of arguments: ``heads``, ``common``
and ``bundlecaps``. We make this list exposed at the module level to let
extensions add content there. This is important for extensions that wish to use
bundle2 for other contents than changegroup.
2014-05-22 01:49:12 -07:00
Durham Goode
e18e8b3005 bundle2: fix bundle2 pulling all revs on empty pulls
When bundle2 was enabled, if hg pull had no commits to pull, it would print
'no changes found' and then download the entire repository from the server. This
was caused by heads and common being set to None, which gets treated as
heads=cl.heads() and common=[nullid], which means download the entire repo.

Pulling bundles without a changegroup is a valid use case (like if we're just
updating bookmarks), so this modifes the bundle code to allow not adding
changegroups.

This is backport of 26ad3517a3a2.
2014-05-07 17:24:19 -07:00
Pierre-Yves David
d55202b92c exchange: fix bad indentation
Those two lines where double indented for no good reasons.

This is backport of d889859ccef0.
2014-05-07 19:26:15 -07:00
Pierre-Yves David
d4684c05ab exchange: propagate arguments to the _getbundleextrapart function
The arguments was wrongly propagated (again).

This a backport of 1c1da5990b8c
2014-05-07 19:28:17 -07:00
Durham Goode
f8ebc64925 bundle2: fix configuration name mismatch
During pulls bundle2 was checking server.bundle2, but during pushes it was
checking experimental.bundle2. This makes them both experimental.bundle2.

This is a backport of a9334b37b19a
2014-05-07 17:20:38 -07:00
Yuya Nishihara
bc04e2c6cd alias: change return code of bad definition to 255
We use 255 for general command error.

It can't raise util.Abort because help module executes badalias command to get
error message.
2014-05-17 15:14:18 +09:00
Matt Mackall
10039fb244 bookmarks: properly align multi-byte characters 2014-05-27 15:16:52 -07:00
Yuya Nishihara
2827ff321c alias: handle shlex error in command aliases
No command should fail with ValueError just because there is unparseable
alias definition.

It returns 1 like other badalias handlers, but should be changed to 255 in
a later version because we use 255 for general command error.
2014-05-17 13:06:16 +09:00
FUJIWARA Katsunori
85d651396d subrepo: normalize path in the specific way for problematic encodings
Before this patch, "reporelpath()" uses "rstrip(os.sep)" to trim
"os.sep" at the end of "parent.root" path.

But it doesn't work correctly with some problematic encodings on
Windows, because some multi-byte characters in such encodings contain
'\\' (0x5c) as the tail byte of them.

In such cases, "reporelpath()" leaves unexpected '\\' at the beginning
of the path returned to callers.

"lcalrepository.root" seems not to have tail "os.sep", because it is
always normalized by "os.path.realpath()" in "vfs.__init__()", but in
fact it has tail "os.sep", if it is a root (of the drive): path
normalization trims tail "os.sep" off "/foo/bar/", but doesn't trim
one off "/".

So, just avoiding "rstrip(os.sep)" in "reporelpath()" causes
regression around issue3033 fixed by e3dfde137fa5.

This patch introduces "pathutil.normasprefix" to normalize specified
path in the specific way for problematic encodings without regression
around issue3033.
2014-05-08 19:03:00 +09:00
FUJIWARA Katsunori
f2a51c0956 subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos
Before this patch, sanitizing ".hg/hgrc" scans directories and files
also in meta data area for non-hg subrepos: under ".svn" for
Subversion subrepo, for example.

This may cause not only performance impact (especially in large scale
subrepos) but also unexpected removing meta data files.

This patch avoids sanitizing ".hg/hgrc" in meta data area for non-hg
subrepos.

This patch stops checking "ignore" target at the first
(case-insensitive) appearance of it, because continuation of scanning
is meaningless in almost all cases.
2014-05-08 19:03:00 +09:00
FUJIWARA Katsunori
8aea0c13e6 subrepo: make "_sanitize()" take absolute path to the root of subrepo
Before this patch, "hg update" doesn't sanitize ".hg/hgrc" in non-hg
subrepos correctly, if "hg update" is executed not at the root of the
parent repository.

"_sanitize()" takes relative path to subrepo from the root of the
parent repository, and passes it to "os.walk()". In this case,
"os.walk()" expects CWD to be equal to the root of the parent
repository.

So, "os.walk()" can't find specified path (or may scan unexpected
path), if CWD isn't equal to the root of the parent repository.

Non-hg subrepo under nested hg-subrepos may cause same problem, too:
CWD may be equal to the root of the outer most repository, or so.

This patch makes "_sanitize()" take absolute path to the root of
subrepo to sanitize correctly in such cases.

This patch doesn't normalize the path to hostile files as the one
relative to CWD (or the root of the outer most repository), to fix the
problem in the simple way suitable for "stable".

Normalizing should be done in the future: maybe as a part of the
migration to vfs.
2014-05-08 19:03:00 +09:00
FUJIWARA Katsunori
a8f723b6c7 subrepo: invoke "_sanitize()" also after "git merge --ff"
Before this patch, sanitizing ".hg/hgrc" in git subrepo doesn't work,
when the working directory is updated by "git merge --ff".

"_sanitize()" is not invoked after checking target revision out into
the working directory in this case, even though it is invoked
indirectly via "checkout" (or "rawcheckout") in other cases.

This patch invokes "_sanitize()" explicitly also after "git merge
--ff" execution.
2014-05-08 19:03:00 +09:00