Commit Graph

1530 Commits

Author SHA1 Message Date
Bryan O'Sullivan
9c88af7c39 with: use context manager for file I/O in memusage 2016-01-15 13:14:45 -08:00
timeless
1af8764a9d check-code: export needs a space to avoid false positives 2016-01-12 15:58:59 +00:00
Mathias De Maré
04fc554bf2 buildrpm: move creation of RPM directories from dockerrpm
Handling the creation of the RPM directories in buildrpm
is more consistent and takes care of non-docker builds as well.
2016-01-07 06:44:37 +01:00
timeless
6128260f9d check-commit: sort errors by line number 2016-01-12 08:34:38 +00:00
timeless
f4c0ab7d00 check-commit: try to fix multiline handling
The old code did not understand the difference between the first line of the summary,
and a random line in the summary that happened to include a #, or a
random line in the changes that happened to include it.

7c3798ffdc0c is an example where it fails
2016-01-12 08:50:15 +00:00
timeless
c4f6fb8fc2 check-commit: support REVs as commandline arguments
usage:
* HG_NODE=REV check-commit
* hg export REV | check-commit
* check-commit REV ...
2016-01-07 01:28:59 +00:00
timeless
971508cd4e check-commit: modularize 2016-01-07 00:55:45 +00:00
timeless
149f294053 check-commit: fix summary length regexp 2016-01-07 03:58:40 +00:00
Gregory Szorc
ddc771a1b2 debugshell: disable demand importer when importing debugger
For reasons I can't explain (but likely have something to do with a
combination of __import__ inferring default values for arguments and
the demand importer mechanism further assuming defaults), the demand
importer isn't playing well with IPython. Without this patch, we get
a failure "ValueError: Attempted relative import in non-package" when
attempting to import "IPython." The stack has numerous demandimport
calls on it and adding "IPython" to the exclude list in demandimport
isn't enough to make the problem go away, which means the issue is
likely somewhere in the bowells of IPython. It's easier to just disable
the demand importer when importing the debugger.
2016-01-11 18:16:38 -08:00
Matt Mackall
3ace626aa9 check-code: allow only-whitespace lines in tests
These turn out to be necessary to embed diffs with blank lines in test
input. So we now complain about whitespace following a character.
2016-01-08 12:35:02 -06:00
Matt Mackall
9b87c36795 check-commit: try to curb bad commit summary keywords
The goal of commit summary keywords is to help us sort, categorize,
and filter our voluminous commits for our release notes in a way
that's helpful and meaningful to end users. Lately, there have been a
huge number of "keywords" that are neither words nor particularly key.

This patch tries to discourage that by narrowing the allowed
characters to alphanumeric. In particular, it doesn't allow "."
(method, function names, and file extensions) and "/" (filenames). It
also gives a short reminder of what a keyword ought to be.
2015-12-10 12:56:23 -06:00
Urs Rau
e104ebf4e7 installer: add windows application version number to inno installer script
This addition to the inno installer script means that the windows uninstaller
registry key “DisplayVersion" is set to the application version number and
will show in Add/Remove Programs.
2016-01-07 12:49:26 +00:00
Matt Harbison
59bfa8869d wix: add help for current internal topics
This makes the changes in 68b7b759ebff and 71a3703364df available on Windows.

I'm not setup to make the installer, so someone with experience in this area
should probably give it a look.  In looking around to try to figure out how to
build the installer, it looks like the Makefile may need an update to $DOCFILES.
2015-12-17 21:24:08 -05:00
Matt Mackall
82e0719648 merge with stable 2016-01-07 17:51:54 -06:00
Mathias De Maré
efbe4fff46 dockerrpm: fix CentOS 5 RPMs (issue4977)
The older rpmbuild in CentOS 5 fails if some of the output directories
have not been created yet. This change results in creating those directories.
2016-01-04 21:21:59 +01: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
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
Gregory Szorc
f5985dcd63 revlog: return offset from _chunkraw()
A subsequent patch will refactor _chunks() and the calculation of the
offset will no longer occur in that function. Prepare by returning the
offset from _chunkraw().
2016-01-05 19:51:51 -08:00
timeless
b863202251 check-code: enforce strict spacing around assignment 2015-12-31 17:41:59 +00:00
timeless
ebb1d48658 cleanup: remove superfluous space after space after equals (python) 2015-12-31 08:16:59 +00:00
Yuya Nishihara
79f9ed4511 import-checker: list package directory as stdlib module
Before this patch, a directory containing __init__.py wasn't counted as a
module and __init__.pyc was listed as foo.bar.__init__ module.
2015-12-27 23:37:14 +09:00
Yuya Nishihara
40d0bc65ac import-checker: normalize directory separator to get module name on Windows
It didn't work if a path contains "\\". Therefore, ctypes.util couldn't be
found on Windows.
2015-12-27 23:48:19 +09:00
Anton Shestakov
169417da80 dockerlib: allow non-unique uid and gid of $DBUILDUSER (issue4657)
There are make targets for building mercurial packages for various
distributions using docker. One of the preparation steps before building is to
create inside the docker image a user with the same uid/gid as the current user
on the host system, so that the resulting files have appropriate
ownership/permissions.

It's possible to run `make docker-<distro>` as a user with uid or gid that is
already present in a vanilla docker container of that distibution. For example,
issue4657 is about failing to build fedora packages as a user with uid=999 and
gid=999 because these ids are already used in fedora, and groupadd fails.
useradd would fail too, if the flow ever got to it (and there was a user with
such uid already).

A straightforward (maybe too much) way to fix this is to allow non-unique uid
and gid for the new user and group that get created inside the image. I'm not
sure of the implications of this, but marmoute encouraged me to try and send
this patch for stable.
2015-11-08 01:10:52 +08:00
Steve Borho
e04f287b5a wix: style-coal.css has been renamed 2015-11-09 09:41:20 -06:00
Augie Fackler
75a732a6ac packaging: rework version detection and declaration (issue4912)
Previously the -rc in our rc tags got dropped, meaning that those
packages looked newer to the packaging system than the later release
build. This rectifies the issue, though some damage may already have
been done on 3.6-rc builds.

I'm mostly cargo-culting the RPM version format - there don't appear
to be rules for RPM about how to handle this. Hopefully an RPM
enthusiast can fix up what I've done as a followup.
2015-10-26 14:19:37 -04:00
timeless
f10778ca64 check-code: allow argument passing py2.6ism
this backs out dead48a12ce0, because Python2.5 support was dropped
2015-10-15 17:28:26 -04:00
timeless
ed8b59f668 win32: drop reference to python2.5 2015-10-15 17:19:11 -04:00
Ryan McElroy
20c45a5f3d editmerge: dequote other use of $ED
We want to support editors with parameters, eg EDITOR="vim -O" or whatever.
So remove the quotes from around $ED and assume that the editor variable is
properly escaped already.
2015-10-19 21:36:12 -07:00
Mads Kiilerich
09567db49a spelling: trivial spell checking 2015-10-17 00:58:46 +02:00
timeless
76f10d8d74 check-code: block non-portable pipe-and 2015-10-15 20:36:12 -04:00
Ryan McElroy
ea5dcaa5fa editmerge: properly quote variables
Previously, files with spaces would break editmerge.
2015-10-17 15:48:14 -07:00
FUJIWARA Katsunori
106983607a dirstate: make dirstate.write() callers pass transaction object to it
Now, 'dirstate.write(tr)' delays writing in-memory changes out, if a
transaction is running.

This may cause treating this revision as "the first bad one" at
bisecting in some cases using external hook process inside transaction
scope, because some external hooks and editor process are still
invoked without HG_PENDING and pending changes aren't visible to them.

'dirstate.write()' callers below in localrepo.py explicitly use 'None'
as 'tr', because they can assume that no transaction is running:

  - just before starting transaction
  - at closing transaction, or
  - at unlocking wlock
2015-10-17 01:15:34 +09:00
Christian Delahousse
c021a178a2 contrib: make editmerge look for merge markers at the beginning of the line
This fix adds a caret to the start of the regex looking for merge markers. This
avoids the issue arises when you've real merge conflicts in a file that tests
for the existance of merge markers in test output. Editmerge will not open on
the fake/tested merge markers because they'll be indented in.
2015-10-16 15:01:42 -07: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
timeless
8dd6ee4d9a check-code: improve test-check-code error diffs
Whenever check-code finds something wrong, the diffs it
generated were fairly hard to read.

The problem is that check-code before this change
would list files that were white listed using
no- check- code but without a glob marker.

Whereas, the test-check-code.t expected output has
no-che?k-code (glob) in order to avoid having itself
flagged as a file to skip.

Thus, in addition to any lines relating to things you
did wrong, all of the white-listed files are listed as
changed.

There is no reason for things to be this painful.

This change makes the output from check-code.py match
the expected output in test-check-code.t
2015-12-24 19:32:14 +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
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
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
Matt Harbison
0cdbeb7bf0 import-checker: force 'ctype.util' to stdlib module
Not having this caused warnings on Windows:

  mercurial/pure/osutil.py:12: stdlib import follows local import: os
  mercurial/pure/osutil.py:13: stdlib import follows local import: socket
  mercurial/pure/osutil.py:14: stdlib import follows local import: stat
  mercurial/pure/osutil.py:15: stdlib import follows local import: sys
2015-12-22 21:47:40 -05:00
timeless
5f0b7179f1 mercurial.spec: remove execute bit 2015-12-22 10:58:47 +00:00
timeless
06572aab33 contrib: add execute bit for fixpax.py 2015-12-22 07:58:44 +00:00
timeless
f8d658c413 contrib: add execute bit for check-py3-compat.py 2015-12-22 07:58:21 +00:00
Gregory Szorc
517d3d4815 perf: make start revision configurable for perfrevlog
This will help isolate performance characteristics of delta chains.
2015-12-20 19:56:23 -08:00
Gregory Szorc
e8cdc56137 perf: use standard arguments for perfrevlog
We have a convention of using -c|-m|FILE elsewhere for reading from
revlogs. Use it for `hg perfrevlog`.

While I was here, I also added a docstring to document what this
command does, as "perfrevlog" is ambiguous.
2015-12-20 19:45:55 -08:00
Matt Mackall
a8248afde0 cleanup: back out performance hacks amended into previous commit 2015-12-21 14:52:18 -06:00
timeless
777dbfe303 commands: consistently indent notes 3 spaces
most notes have 3 spaces for indentation, these had 2...
2015-12-18 06:33:48 +00:00
Gregory Szorc
9f75546b76 perf: add perfrevlogrevision
As part of investigating performance improvements to revlog reading,
I needed a mechanism to measure every part of revlog reading so I knew
where time was spent and how effective optimizations were.

This patch implements a perf command for benchmarking the various
stages of reading a single revlog revision.

When executed against a manifest revision at the end of a 30,000+
long delta chain in mozilla-central, the command demonstrates that
~80% of time is spent in zlib decompression.
2015-12-20 18:38:21 -08:00
Gregory Szorc
179b25b04a perf: call clearcaches() in perfmanifest
The old code only partially cleared the caches. Now that we have a
comprehensive method for wiping all caches, let's call it.

This appears to introduce a marginal regression in `hg perfmanifest`
on mozilla-central. This is good because the new result is more
accurate since caches aren't being used.
2015-12-20 17:57:44 -08:00
Pascal Quantin
edc138619b win32: add internals help topics to Inno Setup installer 2015-12-17 19:33:44 +01:00
Matt Mackall
bfb407a6ed wix: add missing template 2015-12-16 17:17:12 -06:00