Commit Graph

28124 Commits

Author SHA1 Message Date
Jun Wu
505fcee270 chgserver: use basename for socket symlink
Previously we use full path and the symlink may point to outside (unsafe)
world if the directory is moved. This patch fixes it by only linking to
basename of the target. Therefore the symbolic link and socket files will
always stay in the same directory.
2016-03-04 13:18:02 +00:00
Julien Cristau
1c82b3fc6d patch: when importing from email, RFC2047-decode From/Subject headers
Reported at https://bugs.debian.org/737498
2016-03-03 18:34:19 +01:00
timeless
6b7ebe1ed5 histedit: reword message when a changeset produces no changes
There are various ways to use histedit such that an item in
the list of things to perform will not result in a change
relative to the previous repository state.

When that happens, histedit does not keep the commit/message.

This changes the note to try to explain to the user that it
will not be present in their history.
2016-03-02 22:39:03 +00:00
timeless
802e23963d tests: replace cat.py with cat in test-histedit-fold-non-commute.t 2016-03-02 22:09:18 +00:00
Danek Duvall
213f203c87 tests: Solaris grep doesn't add a trailing newline when it's missing
The bad-extension tests emits a list of not-loaded extensions, and pipes
that output through grep.  On Solaris, the test-output gets "(no-eol)"
appended because although the message has no trailing newline, GNU grep
adds it.  If we simply add the newline to the message, the problem goes
away for both versions of grep.
2016-03-02 15:01:41 -08:00
Danek Duvall
9276956bbf tests: Solaris cmp complains about empty files, even with -s
When you compare an empty file, such as /dev/null, with a non-empty file,
Solaris cmp complains on stderr with "cmp: EOF on /dev/null", even if the
-s argument is present.  GNU cmp makes the complaint, but silences it with
-s.  We can change the pdiff utility to simply redirect stderr to /dev/null
so that we don't have to worry about this difference in the test files.
2016-03-02 14:58:29 -08:00
Danek Duvall
ea87ae32e5 tests: Solaris sed does not support "\n" meaning newline in the RHS of s///
The blackbox test rewrites a copy of test-dispatch.py on the fly, and adds
a couple of lines with the s/// command.  GNU sed supports the use of the
\n escape to represent a newline, but not Solaris sed.  Using a literal
newline, prefixed by a backslash, works with both versions of the utility.
2016-03-02 14:55:13 -08:00
Danek Duvall
52c3c76c32 tests: Solaris cp doesn't support the -T option
The treemanifest tests use the -T option to cp in order to ensure that the
two directories named on the commandline are treated as peers, rather than
the usual behavior when the final argument is a directory.  GNU cp has this
option, but other implementations may not.  Thankfully, there's no pressing
reason to use it.  We can simply copy the contents of the first directory
into the target directory, since we know that the target directory already
exists.
2016-03-02 14:50:37 -08:00
Yuya Nishihara
bbfa1c1944 templater: make date() use helper function to evaluate argument
A date argument should never be a generator, but using evalfuncarg() should
be good for consistency.
2016-02-14 13:36:50 +09:00
Yuya Nishihara
946f6161fa templater: fix revset() to evaluate format arguments eagerly
See the previous patch for why. This patch also removes redundant list()
construction from a list.
2016-02-14 00:27:09 +09:00
Yuya Nishihara
f96cf1c058 templater: fix ifcontains() to evaluate items argument eagerly
See the previous patch for why. An "items" argument may be a string,
a generator, or an arbitrary container object.
2016-02-14 00:18:12 +09:00
Yuya Nishihara
85d9fe1400 templater: fix get() to evaluate arguments eagerly
If a key is constructed from a template expression, it may be a generator.
In that case, a key have to be stringified.

A dictarg should never be a generator, but this patch also changes it to
call evalfuncarg() for consistency.
2016-02-14 00:05:58 +09:00
timeless
b31d4af380 import-checker: report local with stdlib late warning
Without this, developers have to figure it out on their own
2016-03-02 15:38:54 +00:00
Gregory Szorc
cc8ad02832 tests: update test output for test written on stable branch (issue5104)
The changed test lines were added in 6a934a7b8d54, which
landed on stable. When this changeset merged to the default
branch, the test failed because 31ed0254094d (on default
but not stable) changed the order of working directory update
when performing a share-based clone from pooled storage.

The changes in this patch are similar to test changes in
31ed0254094d.
2016-03-03 23:11:33 -08:00
Jun Wu
1a7254c1a9 chgserver: pass hashstate and base server address to chgcmdserver
In order to detect a hash change from a request handler, chg must know the
original hashstate. It also needs the base server address to figure out
redirect addresses.
2016-02-29 13:46:54 +00:00
Jun Wu
677d0dce4e chg: drop progress.assume-tty config
It was necessary to go through progress.uisetup() to set up the progressui
wrapper. Since the progress extension has got into the core, progress.assume-tty
is no longer necessary.
2016-02-29 11:43:25 +00:00
Jun Wu
d95149b451 chgserver: mangle server address to include confighash
Before this patch, chgserver will use the address provided by the client. The
new design is one server per confighash. This patch appends "-$confighash" to
the address the client provides. To maintain the compatibility and make sure
the client can connect to the server, a symbolic link is created at the original
address pointing to the new address.

The address is intentionally mangled at the server, instead of being pre-
calculated by some other process (eg. a previous server). In this way, we can
avoid file system race conditions.
2016-03-02 10:10:06 +00:00
Jun Wu
7d41e7c639 chgserver: update docs
Update the docstring to reflect the latest changes
2016-02-29 14:05:45 +00:00
Matt Mackall
2f932b7682 merge with stable 2016-03-02 16:44:56 -06:00
Matt Mackall
1e9175d814 Added signature for changeset 6a934a7b8d54 2016-03-01 18:03:49 -06:00
Gregory Szorc
5b47f5a7bd hg: obtain lock when creating share from pooled repo (issue5104)
There are race conditions between clients performing a shared clone
to pooled storage:

1) Clients race to create the new shared repo in the pool directory
2) 1 client is seeding the repo in the pool directory and another goes
   to share it before it is fully cloned

We prevent these race conditions by obtaining a lock in the pool
directory that is derived from the name of the repo we will be
accessing.

To test this, a simple generic "lockdelay" extension has been added.
The extension inserts an optional, configurable delay before or after
lock acquisition. In the test, we delay 2 seconds after lock acquisition
in the first process and 1 second before lock acquisition in the 2nd
process. This means the first process has 1s to obtain the lock. There
is a race condition here. If we encounter it in the wild, we could
change the dummy extension to wait on the lock file to appear instead
of relying on timing. But that's more complicated. Let's see what
happens first.
2016-02-27 18:22:49 -08:00
FUJIWARA Katsunori
4a0bc54a73 doc: remove deprecated option from synopsis of command help
Before this patch, deprecated options below are used in synopsis of
command help, even though they aren't listed up as available options
by default. These might confuse readers.

  - -n (no-op, now) of strip
  - -a/--active of branches
  - -f/--force of merge
2016-03-01 03:28:46 +09:00
Wagner Bruna
9d5da66d98 i18n-pt_BR: synchronized with bffe7c27f5f7 2016-02-29 22:20:53 -03:00
Matt Mackall
9661ec8b8c merge with i18n 2016-02-29 17:44:00 -06:00
FUJIWARA Katsunori
27b5df55d8 i18n-ja: synchronized with 03346da08322 2016-02-29 22:52:29 +09:00
Pierre-Yves David
afc2550500 revert: properly revert to ancestor of p2 during merge (issue5052)
During merge, added (from one perspective) file can be reported as "modified".
To work around that, revert was testing if modified file were present in the
parent manifest and marking them as "added" in this case. However, we should be
checking against the target revision manifest instead. Otherwise see file as
"newly added" even if they exist in the target revision.

That revert behavior regressed in 3657ae7519b7.
2016-02-23 11:41:47 +01:00
Yuya Nishihara
5b1b6151af log: fix order of revisions filtered by multiple OR options (issue5100)
This is the simplest workaround for the issue of the ordering of revset, which
is that the expression "x or y" takes over the ordering specified by the input
set (or the left-hand-side expression.) For example, the following expression

  A & (x | y)

will be evaluated as if

  (A & x) | (A & y)

That's wrong because revset has ordering. I'm going to fix this problem in
the revset module, but that wouldn't fit to stable. So, this patch just works
around the common log cases.

Since this change might have some impact on performance, it is enabled only
if the expression built from log options has ' or ' operation.
2016-02-15 22:46:07 +09:00
Gregory Szorc
038daf0c4c demandimport: add _imp to ignore list
Mozilla is seeing an issue with demand importing of _imp
failing in pkg_resources/__init__.py:fixup_namespace_packages.
It strangely only reproduces when using a modern version of
setuptools/pip in certain scenarios. Adding _imp to the demand import
ignore list seems to make the problem go away.
2016-02-25 22:35:11 -08:00
Pierre-Yves David
c93d28cfa7 unionrepo: properly handle hidden linkrev in revlog (issue5070)
The unionrepository have to do some special magic to handle linkrev of the
unioned filerev and manifestrev. That logic was done from a repoview and
obsolescence marker affecting bundled changeset could lead to a crash. We now
ensure we operate on unfiltered repository.
2016-02-22 23:36:04 +01:00
Pierre-Yves David
55efb3cd6d bundlerepo: properly handle hidden linkrev in manifestlog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundled manifest. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
2016-02-22 23:34:54 +01:00
Pierre-Yves David
7443f70cc2 bundlerepo: properly handle hidden linkrev in filelog (issue4945)
The bundlerepository have to do some special magic to handle linkrev of the
bundlerepo filerev. That logic was done from a repoview and obsolescence marker
affecting bundled changeset could lead to a crash. We now ensure we operate on
unfiltered repository.
2016-02-22 18:35:40 +01:00
Thomas Arendsen Hein
cd14774b5e help: hg.intevation.de is new primary name of hg.intevation.de (and new cert)
Adjust the examples (prefix and hostfingerprints) in help/config.txt

https://hg.intevation.de/ is now served with a new certificate that is signed
by a commercial CA, so all nearly all browsers will accept it automatically.

Listing both names, hg.intevation.de and hg.intevation.org, in the section
[hostfingerprints] allows using both without configuring web.cacerts and
without changing existing https URLs in the [paths] section.
2016-02-01 12:36:28 +01:00
Rainer Woitok
da96edeb0a doc: correct example concerning "hg purge" alias in man page "hgrc.5"
The "hg purge" alias as currently described in "hgrc.5" only works, if
the caller's current working directory is identical to the repository's
root directory.

This patch slightly modifies the example by adding an empty pattern as a
file argument to the "hg status" command, thus forcing this command to
list the affected files relative to the current directory.
2016-02-20 17:32:26 +01:00
Matt Harbison
0fa9e4d8ca fileset: fix copy/paste in eol() error message 2016-02-18 22:32:18 -05:00
FUJIWARA Katsunori
bf3b0554e8 setup: avoid procedure related to hg.exe at setup.py --pure
Before this patch, "setup.py --pure" fails on Windows, because
hgbuildscripts.run() tries to copy "hg.exe", which doesn't generated
at "setup.py --pure".

At that time, run_command('build_hgexe') invoked in
hgbuildscripts.run() does nothing and returns successfully. Therefore,
subsequent procedure assuming existence of "hg.exe" fails.

This patch avoids procedure related to "hg.exe" (= all of
hgbuildscripts.run() except for build_scripts.run() invocation) at
"setup.py --pure".
2016-02-08 21:12:13 +09:00
Yuya Nishihara
ec5b4c4575 help: update template examples to use reST literal syntax
This should prevent processing backslashes as reST syntax elements. Before
this patch, '\' was lost in HTML and man pages.
2016-02-05 23:17:07 +09:00
Yuya Nishihara
02e214117d ui: fix crash by non-interactive prompt echo for user name
Since we've dropped a str cast at write() by 7dbd3db608c5, ui.prompt() should
convert default to '' if it is None. Otherwise, write() would fail with
"TypeError: object of type 'NoneType' has no len()".

This patch includes the tests for both interactive and non-interactive cases
because "ui.askusername" was never tested.
2016-02-06 20:43:20 +09:00
Yuya Nishihara
61b45241f5 zeroconf: forward all arguments passed to ui.configitems() wrapper
cf6cc5344afa added 'ignoresub' argument to ui.configitems(), but zeroconf
wrapper wasn't updated. It caused the following crash:

  Traceback (most recent call last):
    File "bin/hg", line 43, in <module>
      mercurial.dispatch.run()
    File "lib/python/mercurial/dispatch.py", line 54, in run
      sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
    File "lib/python/mercurial/dispatch.py", line 120, in dispatch
      ret = _runcatch(req)
    File "lib/python/mercurial/dispatch.py", line 191, in _runcatch
      return _dispatch(req)
    File "lib/python/mercurial/dispatch.py", line 924, in _dispatch
      cmdpats, cmdoptions)
    File "lib/python/mercurial/dispatch.py", line 681, in runcommand
      ret = _runcommand(ui, options, cmd, d)
    File "lib/python/mercurial/extensions.py", line 195, in closure
      return func(*(args + a), **kw)
    File "lib/python/hgext/zeroconf/__init__.py", line 180, in cleanupafterdispatch
      return orig(ui, options, cmd, cmdfunc)
    File "lib/python/mercurial/dispatch.py", line 1055, in _runcommand
      return checkargs()
    File "lib/python/mercurial/dispatch.py", line 1015, in checkargs
      return cmdfunc()
    File "lib/python/mercurial/dispatch.py", line 921, in <lambda>
      d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
    File "lib/python/mercurial/util.py", line 991, in check
      return func(*args, **kwargs)
    File "lib/python/mercurial/commands.py", line 5405, in paths
      pathitems = sorted(ui.paths.iteritems())
    File "lib/python/mercurial/util.py", line 723, in __get__
      result = self.func(obj)
    File "lib/python/mercurial/ui.py", line 619, in paths
      return paths(self)
    File "lib/python/mercurial/ui.py", line 1099, in __init__
      for name, loc in ui.configitems('paths', ignoresub=True):
    File "lib/python/mercurial/extensions.py", line 195, in closure
      return func(*(args + a), **kw)
  TypeError: configitems() got an unexpected keyword argument 'ignoresub'

We have no test coverage for zeroconf, so I've added a minimal test that
could reproduce this problem.
2016-02-10 22:53:17 +09:00
timeless
2c0eb26137 rebase: update working directory when aborting (issue5084) 2016-02-05 01:56:46 +00:00
Yuya Nishihara
6b8c99a6d3 revset: flatten chained 'list' operations (aka function args) (issue5072)
Internal _matchfiles() function can take bunch of arguments, which would
lead to a maximum recursion depth error. This patch avoids the excessive
stack use by flattening 'list' nodes beforehand.

Since getlist() no longer takes a nested 'list' nodes, _parsealiasdecl()
also needs to flatten argument list, "aliasname($1, $2, ...)".
2016-02-02 23:49:49 +09:00
André Sintzoff
7d205ba10a help: fix typo in backgroundclose documentation 2016-02-05 19:40:57 +01:00
Matt Mackall
14c6be5d46 Added signature for changeset 48d3cfe1ba91 2016-02-03 16:00:00 -06:00
Siddharth Agarwal
69360ef583 rebase: don't preserve most extra fields
This backs out changeset 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:23:31 -08:00
Siddharth Agarwal
d6d688266e rebase: backout changeset 9b23739c41de
This is a dependency for a future backout of 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:24:47 -08:00
Siddharth Agarwal
82b2cbc2ee rebase: backout changeset 9fd8e3a61d6a
This is a dependency for a future backout of 5293d4f88aef.

See the previous patches for why.
2016-02-03 09:23:52 -08:00
Siddharth Agarwal
08f24f1f67 graft: don't preserve most extra fields
This backs out changeset 9aa13e9feec8.

See the previous patch for why we're doing this.
2016-02-03 09:06:52 -08:00
Siddharth Agarwal
c8ebb66630 amend: don't preserve most extra fields
This backs out changeset fd794e885a9e9.

There are some extra fields that absolutely should not be preserved, like the
convert_revision field introduced by the convert and hgsubversion extensions.
The problem with extensions blacklisting certain extra fields is that they
might not be enabled at the time the amend is performed.

In the long run we probably want separately marked transferable and
non-transferable extra fields, but for now restore the old Mercurial 3.6
behavior.
2016-02-03 08:59:46 -08:00
Wagner Bruna
de70b03c22 histedit: fix typo in documentation 2016-02-03 11:01:11 -02:00
Yuya Nishihara
9d11e83caf osutil: do not abort loading pure module just because libc has no recvmsg()
On Solaris, recvmsg() is provided by libsocket.so. We could try hard to look
for the library which provides 'recvmsg' symbol, but it would make little sense
now since recvfds() won't work anyway on Solaris. So this patch just disables
_recvmsg() on such platforms.

Thanks to FUJIWARA Katsunori for spotting this problem.
2016-02-03 22:47:27 +09:00
Yuya Nishihara
ce2c3d9c16 osutil: disable compilation of recvfds() on unsupported platforms
It appears that Solaris doesn't provide CMSG_LEN(), msg_control, etc. As
recvfds() is only necessary for chg, this patch just drops it if CMSG_LEN
isn't defined, which is the same workaround as Python 3.x.

https://hg.python.org/cpython/rev/c64216addd7f#l7.33
2016-02-02 20:56:48 +09:00