Commit Graph

27336 Commits

Author SHA1 Message Date
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
81170df509 histedit: limit mentioning histedit-last-edit.txt
Before histedit-last-edit.txt would be mentioned for any failure.
After, it should only be mentioned for failures relating to user
input.
2015-12-11 07:08:09 +00:00
timeless
d96f3f0401 histedit: check fold of public change during verify 2015-12-28 22:53:22 +00:00
timeless
9a911bf754 histedit: pass previous action to verify 2015-12-28 22:52:48 +00:00
timeless
08caed46f0 annotate: mention that -n is suppressed in help 2015-12-17 14:56:14 +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
f129ac305b demandimport: update obsolete comment 2015-12-23 16:22:20 -08:00
Bryan O'Sullivan
167ae23759 demandimport: add support for PyPy
PyPy's implementation of __import__ differs subtly from that of CPython.
If invoked without a name or fromlist, it throws an ImportError,
whereas CPython returns a reference to the level-appropriate importing
package.

Here, we achieve the same behaviour by hand.
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
Bryan O'Sullivan
dd14bb51a5 histedit: don't bother with cPickle, demand-load pickle
We're unlikely to ever need the pickle module, so there's no good
reason to force loading of its faster cousin.
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
9c2d540690 histedit: only use pickle if not using the modern save format
This avoids a case where PyPy's cPickle module throws a more confusing
error than CPython's.
2015-12-27 23:55:54 +09: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
6d56e2235c hbisect: use tryreadlines to load state
This closes the file handle after reading, which stops PyPy from
leaking open file handles and thus failing test-bisect3.t.
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
Gregory Szorc
02bc128123 import-checker: force 'logging' to stdlib module
Not sure why this isn't getting picked up. Perhaps we're not handling
stdlib paths that have sub-modules? Something to investigate for another
day...
2015-12-23 12:27:24 -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
timeless
da2a72be71 error: make ParseError inherit from HintException 2015-12-23 17:39:32 +00:00
timeless
5d88e6719b error: refactor OutOfBandError to inherit from HintException 2015-12-23 17:38:24 +00:00
timeless
0126641c07 phases: mention how to make secret commits in help 2015-12-22 20:10:22 +00:00
Bryan O'Sullivan
65b74b5b62 osutil: c_ssize_t is only available in Python >= 2.7 2015-12-22 21:38:06 -08:00
Bryan O'Sullivan
d7b0a811b8 check-seclevel: pass a ui to the extension loader
Without this, if an import error occurs (as with pypy), the attempt to
report it fails since ui is None.
2015-12-22 21:38:06 -08:00
Bryan O'Sullivan
b75f25ac1e check-seclevel: add a --debug option
This will make it possible to get semi-meaningful tracebacks if an import
error occurs.

Why care? Trying to run this script under pypy currently fails, but the
true error is obscured.
2015-12-22 21:38:05 -08:00
Sean Farley
972541224f crecord: stop raising error.Abort if curses is not found (issue5008)
On some servers, python curses support is disabled. This patch not only fixes
that but provides a fallback on other machines (e.g. Windows) when curses is
not found.

The previous code was actually flawed logic and relied on wcurses throwing an
ImportError which demandimport wouldn't throw. So, this patch also fixes that
problem.
2015-12-16 10:39:00 -08:00
Sean Farley
b03ec18822 cmdutil: use crecordmod.checkcurses
Instead of blindly trusting the user's experimental.crecord, we use checkcurses
to abstract that logic so that we can handle the case where python was not
built with curses.
2015-12-15 16:01:45 -08:00
Sean Farley
38fab65a09 crecord: ensure that curses is False if not imported
This provides no functional change but makes the next two patches easier to
review.
2015-12-15 16:00:06 -08:00
Sean Farley
db61c5aa1f crecord: add helper function to determine if we should use curses
To fix issue5008 properly, we need a helper function to determine if curses is
imported and also if the user has enabled the experimental flag.
2015-12-15 15:56:10 -08:00
Sean Farley
e8a52b93c0 crecord: use try/except for import of curses
Not only does this improve fragility with 'if os.name == ...' it will help
future patches enable the behavior to fallback to use plain record when curses
is unavailable (e.g. python compiled without curses support).
2015-12-16 10:33:19 -08: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
Martin von Zweigbergk
0a6dbcd4ad revlog: fix bad indentation (replace tab by space) 2015-12-18 20:54:41 -08:00
Gregory Szorc
2632a8c77a revlog: seek to end of file before writing (issue4943)
Revlogs were recently refactored to open file handles in "a+" and use a
persistent file handle for reading and writing. This drastically
reduced the number of file handles being opened.

Unfortunately, it appears that some versions of Solaris lose the file
offset when performing a write after the handle has been seeked.

The simplest workaround is to seek to EOF on files opened in a+ mode
before writing to them, which is what this patch does.

Ideally, this code would exist in the vfs layer. However, this would
require creating a proxy class for file objects in order to provide a
custom implementation of write(). This would add overhead. Since
revlogs are the only files we open in a+ mode, the one-off workaround
in revlog.py should be sufficient.

This patch appears to have little to no impact on performance on my
Linux machine.
2015-12-17 17:16:02 -08:00
Matt Mackall
11c5081e05 ui: try to handle $$ more robustly in prompts (issue4970) 2015-11-30 13:47:29 -06:00
Siddharth Agarwal
7191433ea2 record: don't dereference symlinks while copying over stat data
Previously, we could be calling os.utime or os.chflags (via shutil.copystat) on
a symlink. These functions dereference symlinks, so this would have caused the
timestamp of the target to be set. On a read-only or similarly weird
filesystem, this might cause an exception to be raised.

This is pretty hard to test because conjuring up a read-only filesystem for
test purposes is non-trivial.
2015-12-12 10:58:05 -08:00
Siddharth Agarwal
5544ae6c91 copyfile: add an optional parameter to copy other stat data
Contrary to the comment, I didn't see any evidence that we were copying
atime/mtime at all. This adds a parameter to copyfile to optionally copy it and
other stat data, with the default being to not copy it.

Many systems don't support changing the timestamp of a symlink, but we don't
need that in general anyway -- copystat is mostly useful for editors, most of
which will dereference symlinks anyway.
2015-12-12 11:00:04 -08: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
Mathias De Maré
148961a2eb dockerlib: short form for non-unique uid/gid for CentOS 5 compat (issue4977)
CentOS 5 does not support '--non-unique', but does support the short '-o'.
2015-12-07 17:39:31 +01: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
Yuya Nishihara
bbbc39e0a4 parsers: fix parse_dirstate to check len before unpacking header (issue4979) 2015-12-02 23:04:58 +09:00
Matt Mackall
ec9590ea23 Added signature for changeset 86c16f25367c 2015-12-01 20:18:28 -06:00
Pierre-Yves David
888da26260 docker: match more version of 'hg docker version' (issue4967)
My version of docker (1.8.3) have a different formating for 'docker version'
that broke the build script. We make the version matching more generic in to
work with both version.
2015-11-24 18:13:25 -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