Commit Graph

20830 Commits

Author SHA1 Message Date
Mads Kiilerich
b117005b7c revlog: use context ancestor instead of changelog ancestor
We want to move in this direction.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
c55887b864 copies: guard debug section with ui.debugflag 2014-02-25 20:31:53 +01:00
Mads Kiilerich
210347bb4f copies: remove _checkcopies wrapper - it does no good
mergecopies might be doomed but it is not dead yet ...
2014-02-25 20:31:51 +01:00
Mads Kiilerich
d164c93242 transplant: use context ancestor instead of changelog ancestor
We want to move in this direction. ctx.ancestor is in a better position for
handling a situation with multiple ancestors.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
861f191408 commit: use revlog.commonancestors instead of .ancestor
This do probably not make any real difference but is slightly more correct and
we would like to get rid of flog.ancestor.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
723c536d44 backout: don't limit heritage check to a single ancestor
This do probably not make any real difference but is slightly more correct and
we would like to get rid of changelog.ancestor.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
421298c7fe ancestor: remove unused genericancestor 2014-03-20 01:35:07 +01:00
Mads Kiilerich
c951e7f8b6 context: remove unused filectx.ancestor 2014-04-07 23:17:48 +02:00
FUJIWARA Katsunori
37e6e5e754 shelve: add "writebundle()" to invoke "writebundle()" with relative path and vfs 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
893cc677a8 shelve: add "applybundle()" to invoke "readbundle()" with relative path and vfs
"applybundle()" also includes "addchangegroup()" invocation to
encapsulate "vfs.join()" inside it.
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
a40858d014 bundlerepo: treat temporarily extracted bundle file via vfs 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
4956966646 vfs: add "mkstemp()" 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
1a5bc49ece repair: make "strip()" treat bundle files via vfs
This patch makes "repair.strip()" treat bundle files via vfs.

This patch also avoids applying "vfs.join()" on the value returned by
"changegroup.writebundle()", to get relative path from "_bundle()".
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
535cdba175 changegroup: add "vfs" argument to "readbundle()" to pass relative filename 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
e26cca0dd1 repair: make paths in "_bundle()" relative to ".hg"
This patch makes paths below in "_bundle()" relative to ".hg":

  - backup directory ("strip-backup"), and
  - bundle file under backup directory

"vfs" is passed to "changegroup.writebundle()" to use relative path
directly.

This patch applies "vfs.join()" on the value returned by "_bundle()",
because the caller expect it to return absolute path.

This will be changed by succeeding patch changing the caller side.
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
01e064edbb changegroup: add "vfs" argument to "writebundle()" for relative access via vfs
Before this patch, filename specified to "changegroup.writebundle()"
should be absolute one.

In some cases, they should be relative to repository root, store and
so on (backup before strip, for example).

This patch adds "vfs" argument to "writebundle()", and makes
"writebundle()" open (and unlink) "filename" via vfs for relative
access, if both filename and vfs are specified.
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
836e13a2f2 localrepo: make "undofiles()" return list of tuples "(vfs, relative filename)"
Before this patch, "localrepository.undofiles()" returns list of
absolute filename of undo files.

This patch makes it return list of tuples "(vfs, relative filename)"
to access undo files via vfs.

This patch also changes "repair.strip()", which is the only user of
"localrepository.undofiles()".
2014-03-09 01:03:28 +09:00
Matt Mackall
48b15e4e36 exchange: fix pyflakes import complaint 2014-04-11 17:20:15 -04:00
Wei, Elson
9d83254247 hgweb: override the charset attribute in the http request
The default http request character set is UTF-8. If the message is not encoded
in UTF-8, such as big5, it cannot be shown correctly. The 'charset' is
overridden by the root document's, such that the user can select the proper
encoding in the browser.
2014-04-10 15:12:12 +08:00
Matt Mackall
34b49de789 diff: use second filename for --stat reporting on git patches (issue4221) 2014-04-11 16:38:55 -04:00
Pierre-Yves David
456f93543d exchange: drop useless line break 2014-04-11 13:43:41 -04:00
Matt Mackall
c73261da0c subrepo: check return code for git push (issue4223) 2014-04-11 15:38:18 -04:00
Pierre-Yves David
69ae281a65 localrepo: add unbundle support
Localrepo now supports the unbundle method of pushing changegroups. We
plan to use the unbundle call for bundle2 so it is important that all
peers supports it. The `peer.unbundle` and `peer.addchangegroup` code
path have small difference so cause some test output changes. None of those
changes seems problematic.
2014-04-04 17:50:44 -07:00
Pierre-Yves David
9c50815f66 unbundle: extract the core logic in another function
The `exchange` module now contains an `unbundle` function that holds the core
unbundle logic. The wire protocol keeps its own unbundle function. It enforces
wireprotocol-specific logic and then calls the extracted function.

This aims at implementing unbundle for localrepo.
2014-04-04 17:28:59 -07:00
Pierre-Yves David
f6ff0fbdf6 unbundle: extract checkheads in its own function
We are going to refactor the unbundle function to have it working on
a local repository too. Having this function extracted will ease the process.

In the case of non-matching heads, the function now directly raises an
exception. The top level of the function is catching it.
2014-04-04 17:15:25 -07:00
Pierre-Yves David
fddf556ac8 phase: apply publishing enforcement for "serve" source
When a changegroup is added by a push on a publishing server, we ensure they
are added as public. This is used to enforce publishing on server when the
client is not aware of phases. It also prevents race conditions where a reader
could see the changesets as draft before they get turned public by the client.
Finally, this save rounds trip as the client does not need additional request to
turn them public.

However, this logic was only enforced when the changegroup was from a "push"
source. And "push" is used for local pushes only. Wireprotocol push uses "serve"
as source since Mercurial 1.9. We now enforce this logic for both "push" and
"serve" sources.

One could note that this logic was mainly useful during wireprotocol exchanges.
So this code is finally put into good use, 9 versions after its introduction.
2014-04-07 18:10:50 -07:00
Matt Mackall
4610a4e481 merge with stable 2014-04-10 12:41:39 -04:00
Matt Mackall
b154d8d029 revlog: deal with chunk ranges over 2G on Windows (issue4215)
Python uses a C long (32 bits on Windows 64) rather than an ssize_t in
read(), and thus has a 2G size limit. Work around this by falling back
to reading one chunk at a time on overflow. This approximately doubles
our headroom until we run back into the size limit on single reads.
2014-04-07 14:18:10 -05:00
Sean Farley
750f67f948 tests: remove unused variables from test-pathencode.py caught by pyflakes 2014-04-03 20:35:56 -05:00
Sean Farley
3c09c4d895 shelve: remove unused variable caught by pyflakes 2014-04-03 20:32:56 -05:00
Sean Farley
90ccd3ca5f changegroup: remove unused variable caught by pyflakes 2014-04-03 20:29:03 -05:00
Matt Mackall
71fa6b44a6 Added signature for changeset bced32a3fd6c 2014-04-01 17:57:04 -05:00
Yuya Nishihara
370defd044 backout: correct commit status of no changes made (BC) (issue4190)
If backout generated no changes to commit, it showed wrong status, "changeset
<target> backs out changeset <target>", and raised TypeError with -v option.

This changes the return code to 1, which is the same as "hg commit" and
"hg rebase".
2014-03-08 18:52:16 +09:00
Yuya Nishihara
d616c909d1 backout: document return code of merge conflict 2014-03-08 18:41:56 +09:00
FUJIWARA Katsunori
0eed53de6c i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that format string consists of multiple string
components concatenated implicitly or explicitly,

This patch does below for that regexp pattern to detect "% inside _()"
problems in such case.

  - put "+" into separator part ("[ \t\n]") for explicit concatenation
    ("...." + "...." style)

  - enclose "component and separator" part by "(?:....)+" for
    concatenation itself ("...." "...." or "...." + "....")
2014-04-01 02:46:03 +09:00
FUJIWARA Katsunori
01d8b27701 i18n: fix "% inside _()" problems
Before this patch, "contrib/check-code.py" can't detect these
problems, because the regexp pattern to detect "% inside _()" doesn't
suppose the case that the format string and "%" aren't placed in the
same line.

This patch replaces "\s" in that regexp pattern with "[ \t\n]" to
detect "% inside _()" problems in such case.

"[\s\n]" can't be used in this purpose, because "\s" is automatically
replaced with "[ \t]" by "_preparepats()" and "\s" in "[]" causes
nested "[]" unexpectedly.
2014-04-01 02:46:03 +09:00
FUJIWARA Katsunori
e0d81db88f merge: fix lack of "%s" in format string causing TypeError at runtime 2014-04-01 02:46:03 +09:00
Wagner Bruna
a79773afe1 i18n-pt_BR: synchronized with a61616787725 2014-04-01 13:27:12 -03:00
FUJIWARA Katsunori
c4397fd764 i18n-ja: synchronized with 53c6e4195bb0 2014-03-31 21:03:39 +09:00
Sean Farley
04ea4eb32d tests: use TESTTMP instead of TESTDIR
In d87f1c1d18fa, be4d37a43992, 394118f2cf71, and 7594c2ea371e, new tests were
added that used TESTDIR instead of TESTTMP thereby leading to polluting the
working directory with these temporary files. Now, we use TESTTMP so that they
will be cleaned up properly.
2014-03-28 14:33:27 -05:00
FUJIWARA Katsunori
920a8f861c hg: introduce "wirepeersetupfuncs" to setup wire peer by extensions (issue4109)
Since changeset a8955c4d9ef5, "reposetup()" of each extensions is
invoked only on repositories enabling corresponded extensions.

This causes that largefiles specific interactions between the
repository enabling largefiles locally and remote (wire) peer fail,
because there is no way to know whether largefiles is enabled on the
remote repository behind the wire peer, and largefiles specific
"wireproto functions" are not given to any wire peers.

To avoid this problem, largefiles should be enabled in wider scope
than each repositories (e.g. user-wide "${HOME}/.hgrc").

This patch introduces "wirepeersetupfuncs" to setup wire peer by
extensions already enabled. Functions registered into
"wirepeersetupfuncs" are invoked for all wire peers.

This patch uses plain list instead of "util.hooks" for
"wirepeersetupfuncs", because the former allows to control order of
function invocation by order of extension enabling: it may be useful
for workaround of problems with combination of enabled extensions
2014-03-29 01:20:07 +09:00
Sean Farley
029b060498 templater: raise error for unknown func
Previously, if a template '{foo()}' was given, the buildfunc would not be able
to match it and hit a code path that would not return so it would error out
later in the templater stating that NoneType was not iterable. This patch makes
sure that a proper error is raised so that the user can be informed.

Tests have been updated.
2014-03-27 17:21:27 -05:00
Jordi Gutiérrez Hermoso
4d640be53b dispatch: only do __import__(debugger) when a debugger is requested
When having ui.debugger=somedebugger in one's ~/.hgrc, this then
somedebugger would be imported for every hg command. With this patch,
this import only happens if the --debugger parameter is passed.
2014-03-07 14:06:52 -05:00
FUJIWARA Katsunori
c52b73121a hg: use "os.path.join()" to join path components which may be empty (issue4203)
Changset 39a4d61c40d6 rewriting "hg.copystore()" with vfs uses
'dstbase + "/lock"' instead of "os.path.join()", because target files
given from "store.copyfiles()" already uses "/" as path separator

But in the repository using revlog format 0, "dstbase" becomes empty
("data" directory is located under ".hg" directly), and 'dstbase +
"/lock"' is treated as "/lock": in almost all cases, write access to
"/lock" causes "permission denied".

This patch uses "os.path.join()" to join path components which may be
empty in "hg.copystore()".
2014-03-25 19:34:17 +09:00
Matt Harbison
60d20455df revset: document the regular expression support for tag(name)
This has been supported since 0041ea008c64, in 2.3.
2014-03-24 21:27:40 -04:00
Siddharth Agarwal
2fd618b0ed subrepo: add trailing newlines to warnings 2014-03-20 19:39:05 -07:00
Siddharth Agarwal
ab73247b7b subrepo: convert matched string to integer before comparing Git version
(1, '4') is greater than (1, 5) so the version check never actually worked.
2014-03-20 19:38:17 -07:00
Siddharth Agarwal
4b233ba647 subrepo: only retrieve the first two components of the Git version
This makes the version detection compatible with Git versions like '1.9-rc0'.
We only cared about the first two components of the version anyway.
2014-03-20 19:37:01 -07:00
Mads Kiilerich
f6b400481f convert: more clear documentation of the 'include' default of a 'include .'
At first glance it can be confusing that adding a superfluous include directive
will exclude more files.
2014-03-19 00:19:54 +01:00
Jordi Gutiérrez Hermoso
19098ea63d commit: propagate --secret option to subrepos (issue4182)
Before this patch, `hg commit --secret` was not getting propagated
correctly, and subrepos were not getting the commit in the secret
phase. The problem is that subrepos get their ui from the base repo's
baseui object and ignore the ui object passed on to them. This sets
and restores both ui objects with the appropriate option.
2014-03-17 14:57:13 -04:00