Commit Graph

28844 Commits

Author SHA1 Message Date
timeless
d41c3c219d store: treat range as a generator instead of a list for py3 compat 2016-04-10 07:28:26 +00:00
Jun Wu
de167181c6 ui: add new config option for help text width
Before this patch, when printing help text using `hg help`, or `hg log -h`,
the output will wrap at 78 chars even if the user has a bigger terminal width
and there is no config option to change it, making the experience different
from the commonly used `man` tool.

This patch introduces a new config option `ui.textwidth`, which replaces the
hardcoded number. It's set to 78 by default to maintain compatibility. When
set to 0, `hg help` will behave more like `man`.
2016-05-04 18:18:24 +01:00
timeless
6cc058ae3c tests: test histedit base command plan help 2016-05-03 15:26:51 +00:00
liscju
45a5b8ca24 largefiles: makes verify batching stat calls to remote
Instead of sending stat calls for each files separately, it sends
one batch call with stat invocations for all files.
2016-05-03 23:48:31 +02:00
liscju
31a5cfa252 largefiles: change basestore._verifyfile to take list of files to check
Makes it easier to use batch stat calls in remotestore to decrease
number of round trips.
2016-05-03 23:31:32 +02:00
timeless
95228c418a rebase: handle successor targets (issue5198)
When a parent has a successor (indicated by revprecursor in state),
we need to use it.
2016-04-11 21:33:07 +00:00
Mike Hommey
7df6eb0ad6 debugbundle: add tests for debugbundle output with bundle2 2016-05-04 06:44:44 +09:00
Nathan Goldbaum
6f4adfc536 revert: mention ui.origbackuppath in the command help 2016-05-04 10:46:27 -05:00
Sean Farley
dcd80c4774 help: wrap ".orig" in rst quotes
Apparently, .orig. is a macro for man pages so we need to wrap it in quotes to
silence lintian warnings.
2016-04-30 18:40:34 -07:00
Yuya Nishihara
10fda3d262 parser: shorten prefix of alias parsing errors
These messages seemed to be a bit long. We should try making them fit to
80-col console.
2016-04-17 12:31:06 +09:00
Yuya Nishihara
77a605117c parser: rephrase "'$' not for alias arguments" message
Say which symbol caused the error. The word "alias" is removed since these
messages are prefixed by "failed to parse ... revset alias "...":".
2016-04-17 12:20:57 +09:00
Mike Hommey
cf14a5ca18 debugbundle: handle the --all option for bundle2 2016-04-18 17:54:02 +09:00
Tony Tung
9f3c4b8958 manifest: improve filesnotin performance by using lazymanifest diff
lazymanifests can compute diffs significantly faster than taking the set
of two manifests and calculating the delta.

when running hg diff --git -c . on Facebook's big repo, this reduces the
run time from 2.1s to 1.5s.
2016-05-02 15:22:16 -07:00
Christian Ebert
81c2d303c5 keyword: replace use of _filerev with _filenode
To be independent of rev numbers.
Analogous to b558712637b8.
2016-04-19 11:00:15 +01:00
Matt Mackall
539d61b5dc Added signature for changeset 38662341e581 2016-05-01 14:36:12 -05:00
Blake Burkhart
a5bebc504a convert: pass absolute paths to git (SEC)
Fixes CVE-2016-3105 (1/1).

Previously, it was possible for the repository path passed to git-ls-remote
to be misinterpreted as a URL.

Always passing an absolute path to git is a simple way to avoid this.
2016-04-06 22:57:46 -05:00
Matt Mackall
c9c3060889 Added signature for changeset 89e922ed00c5 2016-05-01 13:52:26 -05:00
Sean Farley
41d6e5ed5b debian: alphabetize build deps 2016-04-30 21:21:17 -07:00
Sean Farley
35d3b6884b debian: fix lintian warning about debhelper
It seems this is correct but does it work on older distros? I ran the
docker-jessie rule and didn't get any warnings.
2016-04-30 17:26:48 -07:00
Sean Farley
8b7c1af14d builddeb: remove chmod as lintian tells us
It turns out we just need debian/rules to be executable, so we do just that.
2016-04-30 17:29:12 -07:00
Sean Farley
205b5f811e builddeb: use codename in version
Apparently, this is needed to allow ppas to be built for multiple distros.
2016-04-30 11:51:45 -07:00
Pierre-Yves David
aab6e0ee27 rebase: restrict rebase destination to the pulled set (issue5214)
Before this patch, `hg pull --rebase` would be a strict sequence of `hg pull`
followed by `hg rebase` if anything was pulled.

Now that rebase pick his default destination the same way than merge, than
`hg rebase` step would abort in the case the repo already had multiple anonymous
heads (because of the ambiguity). (changed in 8822059a608a)

The intend of the user with `hg pull --rebase` is clearly to rebase on pulled
content. This used to be (mostly) enforced by the former default destination for
rebase, "tipmost changeset of the branch" as the tipmost would likely a
changeset that just got pulled. But this intended was no longer enforced with
the new defaul destination (unified with merge).

This changeset makes use of the '_destspace' mechanism introduced in the previous
changeset to enforce this.

This partially fixes issue5214 as no change at all have been made to the new
handling of the case with bookmark (unified with merge).
2016-04-30 18:39:39 +02:00
Pierre-Yves David
da0dc4d591 destutil: add the ability to specify a search space for rebase destination
In the 'hg pull --rebase', we don't want to pick a rebase destination unrelated
to the pull, we lay down basic infrastructure to allow such restriction on
stable (before 3.8 release) in this case. See issue 5214 for details.

Actual usage and test will be in the next patch.
2016-04-30 18:41:08 +02:00
Gregory Szorc
ad77315d76 sslutil: restore old behavior not requiring a hostname argument (issue5210)
This effectively backs out changeset 60b56b3206cc.

The http library behind ui.http2=true isn't specifying the hostname.
It is the day before the expected 3.8 release and we don't want to ship
a regression.

I'll try to restore this requirement in the 3.9 release cycle as part
of planned improvements to Mercurial's SSL/TLS interactions.
2016-04-30 09:26:47 -07:00
Matt Mackall
9cda77e1b1 tests: test a variety of cache invariants
We've historically had a problem maintaining the expected invariants
on our caches, especially when introducing new caches. This tests
documents the invariants and exercises them across most of our
existing cache files.
2016-04-28 16:38:15 -05:00
Matt Mackall
a684f1361f repoview: ignore unwritable hidden cache
The atomictemp.close() file attempts to do a rename, which can fail.
Moving the close inside the exception handler fixes it.

This doesn't fit well with the with: pattern, as it's the finalizer
that's failing.
2016-04-28 16:26:18 -05:00
Matt Mackall
37e825cd02 tags: silence hgtagsfnodes reading failures
tryread() doesn't handle "is a directory" errors and presumably
others. We might not want to globally swallow such tryread errors, so
we replace with our own try/except handling.

An upcoming test will use directories as a portable stand-in for
various bizarre circumstances that cache read/write code should be
robust to.
2016-04-28 15:40:43 -05:00
Matt Mackall
8ad154abd6 tags: silence cache parsing errors
Follow our standard STFU cache-handling pattern
2016-04-28 15:35:54 -05:00
Wagner Bruna
9fe82bf618 i18n-pt_BR: synchronized with 2ae54831e766 2016-05-01 00:12:56 -03:00
Sean Farley
ca1aff7fdb ubuntu-xenial-ppa: add makefile rule 2016-04-27 01:07:40 -07:00
Sean Farley
83ef160aa1 ubuntu-wily-ppa: add makefile rule 2016-04-27 01:02:56 -07:00
Sean Farley
49dcbb48fa ubuntu-trusty-ppa: add makefile rule 2016-04-27 00:27:10 -07:00
Sean Farley
492deac0a3 ubuntu-xenial: add makefile rule to build deb 2016-04-27 00:18:18 -07:00
Sean Farley
8d241b8149 ubuntu-wily: add makefile rule to build deb 2016-04-27 00:10:49 -07:00
Sean Farley
bf3866fc9f make: turn ubuntu docker into template
This allows us to easily add more ubuntu docker targets (which following
patches will do).

Also, we no longer need the mkdir command.
2016-04-26 23:33:17 -07:00
Sean Farley
bf3cdfa44b revsets: add docs for '%' operator 2016-04-27 14:02:18 -07:00
Adam Simpkins
49958f0c37 graft: fix printing of --continue command
Properly shell quote arguments, to avoid printing commands that won't work when
run literally.  For example, a date string with timestamp needs to be quoted:
--date '1456953053 28800'
2016-04-27 19:24:31 -07:00
Kevin Bullock
5296280949 hghave: remove unused check for bdist_mpkg 2016-04-29 14:14:00 -05:00
Kevin Bullock
971fb62b26 osx: create a modern package including manpages
Instead of using bdist_mpkg, we use the modern Apple-provided tools to
build an OS X Installer package directly. This has several advantages:

* Avoids bdist_mpkg which seems to be barely maintained and is hard to
  use.
* Creates a single unified .pkg instead of a .mpkg.
* The package we produce is in the modern, single-file format instead of
  a directory bundle that we have to zip up for download.

In addition, this way of building the package now correctly:

* Installs the manpages, bringing the `make osx`-generated package in
  line with the official Mac packages we publish on the website.
* Installs files with the correct permissions instead of encoding the
  UID of the user who happened to build the package.

Thanks to Augie for updating the test expectations.
2016-04-27 10:20:36 -05:00
Augie Fackler
5b68eb5b4f hghave: add check for OS X packaging tools 2016-04-27 11:45:55 -04:00
Augie Fackler
847ad59183 tests: add test for Mac OS X package construction 2016-04-18 23:59:55 -04:00
Augie Fackler
8b0b581117 osx: add support for keeping mpkgs
This is a bit of a hack, but I don't really want to mount a dmg during
a test, and I don't see an option with hdiutil to take a dmg and spit
out a folder, so this is what we've got for now.
2016-04-18 23:59:28 -04:00
Augie Fackler
a7f803602c osx: add support for dumping built dmg into OUTPUTDIR 2016-04-18 23:57:22 -04:00
Augie Fackler
2f69b1cab6 hghave: add check for bdist_mpkg 2016-04-18 23:55:58 -04:00
Matt Harbison
3036220cae verify: don't init subrepo when missing one is referenced (issue5128) (API)
Initializing a subrepo when one doesn't exist is the right thing to do when the
parent is being updated, but in few other cases.  Unfortunately, there isn't
enough context in the subrepo module to distinguish this case.  This same issue
can be caused with other subrepo aware commands, so there is a general issue
here beyond the scope of this fix.

A simpler attempt I tried was to add an '_updating' boolean to localrepo, and
set/clear it around the call to mergemod.update() in hg.updaterepo().  That
mostly worked, but doesn't handle the case where archive will clone the subrepo
if it is missing.  (I vaguely recall that there may be other commands that will
clone if needed like this, but certainly not all do.  It seems both handy, and a
bit surprising for what should be a read only operation.  It might be nice if
all commands did this consistently, but we probably need Angel's subrepo caching
first, to not make a mess of the working directory.)

I originally handled 'Exception' in order to pick up the Aborts raised in
subrepo.state(), but this turns out to be unnecessary because that is called
once and cached by ctx.sub() when iterating the subrepos.

It was suggested in the bug discussion to skip looking at the subrepo links
unless -S is specified.  I don't really like that idea because missing a subrepo
or (less likely, but worse) a corrupt .hgsubstate is a problem of the parent
repo when checking out a revision.  The -S option seems like a better fit for
functionality that would recurse into each subrepo and do a full verification.

Ultimately, the default value for 'allowcreate' should probably be flipped, but
since the default behavior was to allow creation, this is less risky for now.
2016-04-27 22:45:52 -04:00
Gregory Szorc
ec5e1b8364 setup: detect Python DLL filename from loaded DLL
Attempting to build Mercurial from source using MinGW from
msys2 on Windows produces a hg.exe that attempts to load e.g.
python27.dll. MinGW prefixes its library name with "lib" and
adds a period between the major and minor versions. e.g.
"libpython2.7.dll."

Before this patch, hg.exe files in a MinGW environment would
either fail to find a Python DLL or would attempt to load a
non-MinGW DLL, which would summarily explode. Either way,
hg.exe wouldn't work.

This patch improves the code that determines the Python DLL
filename to actually use the loaded Python DLL instead of
inferring it. Basically we take the handle of the loaded DLL
from sys.dllhandle and call a Windows API to try to resolve
that handle to a filename.
2016-04-28 08:52:13 -07:00
Gregory Szorc
b30a08bac0 exewrapper: add .dll to LoadLibrary() argument
LoadLibrary() changes behavior depending on whether the argument
passed to it contains a period. From the MSDN docs:

If no file name extension is specified in the lpFileName parameter,
the default library extension .dll is appended. However, the file name
string can include a trailing point character (.) to indicate that the
module name has no extension. When no path is specified, the function
searches for loaded modules whose base name matches the base name of
the module to be loaded. If the name matches, the load succeeds.
Otherwise, the function searches for the file.

As the subsequent patch will show, some environments on Windows
define their Python library as e.g. "libpython2.7.dll." The existing
code would pass "libpython2.7" into LoadLibrary(). It would assume
"7" was the file extension and look for a "libpython2.dll" to load.

By passing ".dll" into LoadLibrary(), we force it to search for the
exact basename we want, even if it contains a period.
2016-04-27 09:23:39 -07:00
Martin von Zweigbergk
5746133750 update: correct description of --check option
The old "update across branches if no uncommitted changes" made
it sound like updating across branches (with no uncommitted changes)
was allowed only with this option, which was not true. Also, the option
did not care whether it was linear or across branches. Instead, it
checked that there were no uncommitted changes. Let's explain what it
does instead of trying to suggest what happens without it.
2016-04-27 14:02:54 -07:00
Adam Simpkins
c92a68e75e util: fix race in makedirs()
Update makedirs() to ignore EEXIST in case someone else has already created the
directory in question.  Previously the ensuredirs() function existed, and was
nearly identical to makedirs() except that it fixed this race.  Unfortunately
ensuredirs() was only used in 3 places, and most code uses the racy makedirs()
function.  This fixes makedirs() to be non-racy, and replaces calls to
ensuredirs() with makedirs().

In particular, mercurial.scmutil.origpath() used the racy makedirs() code,
which could cause failures during "hg update" as it tried to create backup
directories.

This does slightly change the behavior of call sites using ensuredirs():
previously ensuredirs() would throw EEXIST if the path existed but was a
regular file instead of a directory.  It did this by explicitly checking
os.path.isdir() after getting EEXIST.  The makedirs() code did not do this and
swallowed all EEXIST errors.  I kept the makedirs() behavior, since it seemed
preferable to avoid the extra stat call in the common case where this directory
already exists.  If the path does happen to be a file, the caller will almost
certainly fail with an ENOTDIR error shortly afterwards anyway.  I checked
the 3 existing call sites of ensuredirs(), and this seems to be the case for
them.
2016-04-26 15:32:59 -07:00
Yuya Nishihara
c61ec06302 chg: initialize sockdirfd to -1 instead of AT_FDCWD
As we don't use sockdirfd yet, this is the simplest workaround to compile chg
on old Unices where AT_FDCWD does not exist. Foozy pointed out Mac OS X 10.10
is required for AT_FDCWD as well as xxxat() functions.
2016-04-24 21:35:30 +09:00