Commit Graph

34927 Commits

Author SHA1 Message Date
Kevin Bullock
8f9983c9f0 Added signature for changeset bfd77d488124 2017-11-01 16:54:39 -05:00
Jun Wu
04a084983c test-dispatch: stabilize the test
When cwd is removed and `hg` is executed, some shells may run `getcwd`
before forking and executing, some may not do it, some may print a
different error message.

The test should be shell-independent so let's just avoid checking the error
message.

Differential Revision: https://phab.mercurial-scm.org/D1282
2017-11-01 14:22:26 -07:00
Kevin Bullock
0c315becfe internals: update test-help.t for config registrar copy-edit 2017-11-01 15:34:22 -05:00
Kevin Bullock
8b1854807c internals: copy-edit "register" -> "registrar" in configitem docs 2017-11-01 13:24:08 -05:00
Augie Fackler
69ce54473a merge with i18n 2017-11-01 16:07:33 -04:00
Wagner Bruna
27cee4a057 i18n-pt_BR: synchronized with cb9be6b29e0b 2017-11-01 08:31:16 -02:00
Matt Harbison
ba66d4513f help: minor copy editing for grammar 2017-10-31 23:09:29 -04:00
Yuya Nishihara
21161a9bda configitems: relax warning about unwanted default value
The original condition was a bit harsh for extension authors since third-party
extensions need to preserve compatibility with older Mercurial versions, where
no defaults would be loaded from the configtable. So let's silence the warning
if the given default value matches, which should be harmless.
2017-10-31 22:37:30 +09:00
Kostia Balytskyi
b244c1e330 filemerge: pass a default value to _toolstr (issue5718)
After a refactoring, _toolstr stopped having default="" as one of it's args,
therefore when called without a default it returns None and not "". This causes
concatenation to fail.
2017-10-26 11:07:06 -07:00
Pulkit Goyal
023a6862fc children: fix the log expansion of hg children in doc
`hg log -r children()` returns `hg: parse error: missing argument`.

Differential Revision: https://phab.mercurial-scm.org/D1269
2017-10-31 06:39:38 +05:30
Yuya Nishihara
1fa3521832 test-static-http: flush access log per request
It appears that stderr is fully buffered on Windows.

# no-check-commit because of log_message() function
2017-10-29 17:53:52 +09:00
Yuya Nishihara
956c057ed5 statichttprepo: do not use platform path separator to build a URL
It wouldn't work between Windows client and Unix server.
2017-10-28 17:23:52 +09:00
Siddharth Agarwal
2d9d1fcc19 merge: disable path conflict checking by default (issue5716)
We shouldn't ship a severe perf regression in hg update for 4.4.

Differential Revision: https://phab.mercurial-scm.org/D1223
2017-10-24 11:15:30 -07:00
Siddharth Agarwal
1fe04b20a0 merge: add a config option to disable path conflict checking
We've found a severe perf regression in `hg update` caused by the path conflict
checking code. The next patch will disable this by default.

Differential Revision: https://phab.mercurial-scm.org/D1222
2017-10-24 11:14:38 -07:00
Joe Blaylock
f9b24c83ac help: fix typo in hg merge documentation 2017-10-20 14:15:46 -07:00
Kevin Bullock
6cdd14dc97 Added signature for changeset 5ade01c0899f 2017-10-20 13:44:38 -05:00
Mark Thomas
1d4d162882 dirstate: clean up when restoring identical backups
When a dirstate backup is restored, it is possible that no actual changes to
the dirstate have been made.  In this case, the backup is still a hardlink
to the original dirstate.

Unfortunately, `os.rename` silently fails (nothing happens, and no error
occurs) when `src` and `dst` are hardlinks to the same file.  As a result,
the backup is left lying around.  Over time, these files accumulate.

When restoring dirstate backups, check if the backup and the dirstate are
the same file, and if so, just delete the backup.

Differential Revision: https://phab.mercurial-scm.org/D1201
2017-10-20 05:53:35 -07:00
Mark Thomas
0a3c5d4762 tests: add a test demonstrating failure to clean up dirstate backups
Differential Revision: https://phab.mercurial-scm.org/D1200
2017-10-20 05:53:33 -07:00
Matt Harbison
bd8eaff510 tests: adjust hooks for Windows
I'm not sure why these weren't working on Windows.  The failures were generally
in the style of:

  -  remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
  +  remote: "phase-move: $HG_NODE:  $HG_OLDPHASE -> $HG_PHASE"

and

  -  abort: pretxnclose-bookmark.force-forward hook exited with status 1
  -  [255]
  +  abort: pretxnclose-bookmark.force-public hook exited with status 255
  +  [255]

These failures originated in 5625d0ddc285::6e3e88681b23.
2017-10-20 23:01:56 -04:00
Matt Harbison
0aa0daf3f0 test-log-linerange: open binary file in binary mode
The '\n' characters were being translated on Windows, throwing off hg and git
hashes, as well as the file content in the diff.
2017-10-20 21:29:15 -04:00
Matt Harbison
80170c3cd7 test-arbitraryfilectx: stabilize for Windows
Previously, the second last test (context.arbitraryfilectx(..)) returned True on
Windows.  I changed the repo setup sequence to import a patch, so that way the
repo would have a proper symlink.  That made the last test fail, since it is
comparing files in wdir(), one of which is not the expected symlink.

Apparently the (feature !) line matching doesn't work well with (no-eol), so I
had to conditionalize the test instead of the output.
2017-10-19 23:16:48 -04:00
Durham Goode
35f758a851 dirstate: remove excess attribute lookups for dirstate.status (issue5714)
A recent refactor added a layer of abstraction to the dirstate which makes doing
things like 'foo in dirstate' now require some extra Python attribute lookups.
This is causing a 100ms slow down in hg status for mozilla-central.

The fix is to hoist the inner dict's functions onto the main class once the lazy
loading it complete, as well as store the actual functions before doing the
status loop (as is done for other such functions).

In my testing, it seems to address the performance regression, but we'll
need to see the perf run results to know for sure.

Differential Revision: https://phab.mercurial-scm.org/D1257
2017-10-28 12:35:54 -07:00
Durham Goode
c83eaaa0f1 dirstate: avoid reading the map when possible (issue5713) (issue5717)
Before the recent refactor, we would not load the entire map until it was
accessed. As part of the refactor, that got lost and even just trying to load
the dirstate parents would load the whole map. This caused a perf regression
(issue5713) and a regression with static http serving (issue5717).

Making it lazy loaded again fixes both.

Differential Revision: https://phab.mercurial-scm.org/D1253
2017-10-26 16:15:36 -07:00
Durham Goode
6a075fddcc dirstate: move clear onto dirstatemap class
A future diff will move the lazy loading aspect of dirstate to the dirstatemap
class. This means it requires a slightly different strategy of clearing than
just reinstantiating the object (since just reinstantiating the object will
lazily load the on disk data again later instead of remaining permanently
empty).

So let's give it it's own clear function.

Differential Revision: https://phab.mercurial-scm.org/D1252
2017-10-26 16:15:31 -07:00
Boris Feld
2d8cec51a9 internal-doc: document the config register mechanism
This explains the various usage and feature of the config register introduced
in Mercurial 4.3 and 4.4.
2017-10-27 18:19:07 +02:00
Boris Feld
51339acb82 help: clarify the pre-txnclose-phase documentation
Gregory Szorc requested some clarification.
2017-10-27 21:43:22 +02:00
Boris Feld
33f349a991 internal-doc: document the 'phases' parameters to 'getbundle'
The getbundle wireprotocol method has some extended documentation. We update it
with the next parameters introduced for binary phases.
2017-10-27 21:35:34 +02:00
Matt Harbison
258062fa5b status: update the help to indicate that clean files are not normally tersed
The same applies to '?' if --quiet is used (or any of the other states if some
of -marduic is specified), but I couldn't figure out how to express that
clearly.
2017-10-28 00:00:05 -04:00
Matt Harbison
9eb4def389 terse: split on repo separator instead of os.sep (issue5715)
The paths being processed are from scmutil.status, and therefore normalized to
'/' separators.
2017-10-27 23:48:38 -04:00
Anton Shestakov
baa04128f5 makefile: put format-c into .PHONY targets 2017-10-26 11:58:55 +08:00
Yuya Nishihara
73e9f96212 statichttprepo: prevent loading dirstate over HTTP on node lookup (issue5717)
This seems a bit hacky, but works well. There should be no reason that
static-http repo had to load dirstate.

Initially I tried to proxy os.stat() call through vfs so that statichttpvfs
could hook it, but there wasn't a good error value which the statichttpvfs
could return to get around the util.filestat issue.
2017-10-25 21:58:03 +09:00
Yuya Nishihara
e368124f71 test-static-http: show all files accessed over HTTP
This provides some confidence on files that should be loadable over HTTP.
Hopefully it will prevent future bugs.
2017-10-25 21:21:42 +09:00
Yuya Nishihara
86972fbe07 server: drop executable bit from daemon log file
The logfile option was unused, so it was okay until now.
2017-10-25 21:20:01 +09:00
Kevin Bullock
6264723128 setup: filter out devel-warn messages from system hg
If we're going to use the user's installed and configured hg command
(which we do since a4a6cb293e63), we should prevent devel-warn messages
from interfering with locating it.
2017-10-23 22:13:59 -05:00
Kevin Bullock
1a166f93b9 setup: remove duplicate assignment of HGRCPATH
HGRCPATH is already set in localhgenv().
2017-10-23 21:30:59 -05:00
Kevin Bullock
4073f3374c packaging: update book URL in Mac and Windows READMEs 2017-10-20 13:54:51 -05:00
muxator
aaf12eb558 commands: be more uniform in an "hg update" error message
"can only specify one of -C/--clean, -c/--check, or -m/merge"
becomes
"can only specify one of -C/--clean, -c/--check, or -m/--merge"
2017-10-23 22:45:24 +02:00
Pulkit Goyal
c4428f695a uncommit: unify functions _uncommitdirstate and _unamenddirstate to one
The _unamenddirstate() function was inspired by _uncommitdirstate() function as
the logic was same but we were unable to use the latter function directly. So
previous patch introduced the _unamenddirstate() function and now this patch
unifies both the function and we have a _fixdirstate() function.

Adding function in previous patch and unifying in a later patch makes the
reasoning easier and also leaves the last patch dedicated to what it is meant to
be.

Differential Revision: https://phab.mercurial-scm.org/D971
2017-10-06 04:17:36 +05:30
muxator
571ba67b50 update: mention long options explicitly in description of merge.update()
The short options "-c" and "-C" may be confusing for a novice reading the
documentation. Let's try to be more explicit, also mentioning the equivalent
long options ("--check" and "--clean") in the comments.
2017-10-04 23:22:34 +02:00
Yuya Nishihara
feaa3f8a8c mq: copy pager attributes back to qrepo.ui
If the legacy pager extension is enabled, a pager is started through repo.ui
at dispatch._runcommand(). After that, mqcommand() creates a qrepo with a
fresh repo.baseui, at which point pager information was lost and another pager
would be spawned by the modern pager interface.

This is a minimal workaround for the problem.
2017-10-21 13:42:43 +09:00
Yuya Nishihara
9e02f75b4c registrar: host "dynamicdefault" constant by configitem object
This is the common pattern seen in the other registrar classes.
2017-10-21 13:13:20 +09:00
Yuya Nishihara
74c1bd2363 configitems: register 'ui.editor' 2017-10-21 13:04:58 +09:00
Pulkit Goyal
9e302c97ba unamend: move fb extension unamend to core
unamend extension adds an unamend command which undoes the effect of the amend
command. This patch moves the unamend command from that extension to uncommit
extension and this one does not completely undoes the effect of amend command as
it creates a new commit, rather than reviving the old one back.

This also adds tests for the same.

.. feature::

   A new unamend command in uncommit extension which undoes the effect of the
   amend command by creating a new changeset which was there before amend and
   moving the changes that were amended to the working directory.

Differential Revision: https://phab.mercurial-scm.org/D821
2017-09-24 00:56:52 +05:30
Augie Fackler
b162ade5b4 color: respect HGPLAINEXCEPT=color to allow colors while scripting (issue5749)
I'd also like --color=always on the command-line to override HGPLAIN=1
et al, but that's more work, and this seems like a better fix. We've
got a fair number of programs that actually want to automate hg and
get colored output to users, so they should set HGPLAINEXCEPT=alias
(what we usually recommend), but this has been breaking them because
they then lose color.

.. feature::

  The ``HGPLAINEXCEPT`` environment variable can now include ``color``
  to allow automatic output colorization in otherwise automated
  environments.

Differential Revision: https://phab.mercurial-scm.org/D1532
2017-11-28 13:27:43 -05:00
Yuya Nishihara
83b6143332 test-ssh: do not actually look up "brokenrepository" by DNS 2017-11-26 11:22:27 +09:00
Matt Harbison
aa082f0ff7 largefiles: explicitly set the source and sink types to 'hg' for lfconvert
I stumbled into this prior to adding the type indicator on the source and sink,
but there's no reason to try to infer the types for this conversion.
2017-11-23 01:21:10 -05:00
Matt Harbison
0a5e6b5a69 lfs: add a repo requirement for this extension when converting to lfs
This covers both the vanilla repo -> lfs repo and largefiles -> lfs conversions.
The largefiles extension adds the requirement directly, because it has a
dedicated command to convert.  Using the convert extension is better, because it
supports more features.

I'd like ideas about how to ensure that converting away from lfs works on all
files.  (See comments in test-lfs.t)
2017-11-22 22:38:50 -05:00
Matt Harbison
2583a8e324 convert: allow the sink object to be wrapped when the extension isn't loaded
The next patch will wrap the conversion code, in order to write out a
requirement for 'lfs' when appropriate.  Wrapping convcmd.convertsink() in an
afterloaded callback works fine when the convert extension is enabled by the
user.  The problem here is that lfconvert uses the convert extension, whether or
not it was formally enabled by the user.

My first attempt was to have lfs install an afterloaded callback that would wrap
the convert sink if convert was loaded, or wrap lfconvert if it wasn't.  Then
the lfconvert override could install an afterloaded callback to try wrapping the
convert sink again, before calling the original lfconvert.  But that breaks down
if largefiles can't load the convert extension on the fly. [1]  Further, some
tests were failing with an error indicating that the size of the afterloaded
list changed while iterating it.

Yuya mentioned that maybe some bits of convert could be moved into core, but I'm
not sure where to draw that line.  The convertsink() method depends on the list
of sinks, which in turn depends on the sink classes.

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-November/108038.html
2017-11-26 14:59:39 -05:00
Matt Harbison
f73ca1dafd convert: save an indicator of the repo type for sources and sinks
This seems like basic info to have, and will be used shortly when deciding
whether or not to wrap the class for lfs conversions.

The other option is to just add a function to each class.  But this seems better
in that the strings aren't duplicated, and the constructor for most of these
will run even if the VCS isn't installed, so it's easier to catch errors.
2017-11-22 20:49:01 -05:00
Matt Harbison
ed0e86ccdb lfs: add a repo requirement for this extension once an lfs file is committed
Largefiles does the same thing (also delayed until the first largefile commit),
to prevent access to the repo without the extension.  In the case of this
extension, not having the extension loaded while accessing an lfs file results
in cryptic errors about "missing processor for flag '0x2000'".  If enabled
locally but not remotely, the cryptic error message is about no common
changegroup version.  (It wants '03', which is currently experimental.)

The largefiles extension looks for any tracked file that starts with '.hglf/'.
Unfortunately, that doesn't work here.  I didn't see any way to get the files
that were just committed, without doing a full status.  But since there's no
secondary check on adding an lfs file once the extension is loaded and a
threshold set, the best practice is to only enable this locally on a repo that
needs it.  That should minimize the unnecessary overhead for repos without an
lfs file.
2017-11-15 23:43:15 -05:00