Commit Graph

9401 Commits

Author SHA1 Message Date
Gregory Szorc
4d22c2ded4 lsprofcalltree: use print function
While I was here, some single element tuples have been removed in
favor of the shorter syntax. Some commented lines of code containing
print statements have also been removed because it was unclear what
purpose they served.
2016-01-02 11:45:29 -08:00
Gregory Szorc
742b6fa534 lsprof: use print function 2016-01-02 11:40:53 -08: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
Siddharth Agarwal
a6934b01c3 merge: while checking for unknown files don't follow symlinks (issue5027)
Previously, we were using Python's native 'os.path.isfile' method which follows
symlinks. In this case, since we're operating on repo contents, we don't want
to follow symlinks.

There's a behaviour change here, as shown by the second part of the added test.
Consider a symlink 'f' pointing to a file containing 'abc'. If we try and
replace it with a file with contents 'abc', previously we would have let it
though. Now we don't. Although this breaks naive inspection with tools like
'cat' and 'diff', on balance I believe this is the right change.
2015-12-28 22:51:37 -08: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
Yuya Nishihara
f69357a4da push: restore old behavior of default-push (issue5000)
This effectively backs out 163c899d1e46 and f44b0edaab90.

We can't handle "default-push" just like "default:pushurl" because it is a
stand-alone named path. Instead, I have two ideas to work around the issue:

 a. two defaults: getpath(dest, default=('default-push', 'default'))
 b. virtual path: getpath(dest, default=':default')

(a) is conservative approach and will have less trouble, but callers have
to specify they need "default-push" or "default". (b) generates hidden
":default" path from "default" and "default-push", and callers request
":default". This will require some tricks and won't work if there are
conflicting sub-options valid for both "pull" and "push".

I'll take (a) for default branch. This patch should NOT BE MERGED to default
except for tests because it would break handling of "pushurl" sub-option.
2015-12-26 15:18:16 +09: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
FUJIWARA Katsunori
4d3a0ec7d1 mq: use fallback patch name if no alpha-numeric in summary line (issue5025)
Before this patch, "hg qimport -r REV" fails, if the summary line of
description of REV doesn't contain any alpha-numeric bytes.

In this case, all bytes in the summary line 'title' are dropped from
'namebase' by the code path below.

     namebase = re.sub('[\s\W_]+', '_', title.lower()).strip('_')

'makepatchname()' immediately returns this empty string as valid patch
name, because patch name conflicting against empty string never
exists.

Then, "hg qimport -r REV" is aborted at creation of patch file with
empty filename.

This situation isn't so rare. For example, ordinary texts in Japanese
often consist of non alpha-numeric bytes in UTF-8.

This patch makes 'makepatchname()' use fallback patch name if the
summary line of imported revision doesn't contain any alpha-numeric
bytes.
2015-12-23 22:28:52 +09: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
Yuya Nishihara
e95ba280a6 paths: include #fragment again
Since 3be994f0f015, #fragment was missing in "hg paths" output because
path.loc was changed to a parsed URL. "hg paths" should use path.rawloc to
show complete URLs.
2015-12-07 21:42:50 +09:00
Sietse Brouwer
f5fed5a270 dirstate: don't write repo.currenttransaction to repo.dirstate if repo
is None (issue4983)

Some hooks, such as post-init and post-clone, do not get a repo parameter in
their environment. If there is no repo, there is no repo.currenttransaction();
attempting to retrieve it anyway was causing crashes. Now currenttransaction is
only retrieved and written if the repo is not None.
2015-12-03 01:38:21 +01:00
Gregory Szorc
4e3200d742 tests: test changegroup generation for filtered changesets (issue4982)
The test demonstrates the buggy behavior from issue4982 where the
changegroup contains changesets it shouldn't.
2015-12-02 14:20:13 -08:00
Siddharth Agarwal
bb5af1afc4 localrepo.commit: check all files for resolve state (issue4972)
Previously we were only checking modified files for their resolve state. But a
file might be unresolved yet not in the modified state. Handle all such cases
properly.
2015-11-30 16:31:28 -08:00