Commit Graph

27196 Commits

Author SHA1 Message Date
timeless
2abe9172f6 histedit: omit useless message from update (edit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:04:17 +00:00
timeless
26fb25b6cd histedit: omit useless message from update (_histedit)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:37:31 +00:00
timeless
5551448efc histedit: omit useless message from update (histeditaction)
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 21:43:16 +00:00
timeless
44748f7f11 update: add quietempty flag to _showstats
if called with quietempty=True, suppress:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:14:06 +00:00
timeless
0853af047a histedit: omit useless message from abort
specifically:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 22:08:14 +00:00
timeless
31ad01fbf1 hg: add quietempty flag to _showstats
if called with quietempty=True, suppress:
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
2015-12-14 23:13:25 +00:00
Mateusz Kwapich
dcddc82bed patch: disable nobinary when HGPLAIN=1
The diff output without binaries is definitely great for interactive users - a
binary patch is not meaningful for them. Although setting diff.nobinary flag
can break the automation. Let's force full output for automation.
2015-12-17 11:00:06 -08:00
Yuya Nishihara
c1ebc705e5 help: add missed last new line to "internals" topic
Caught by test-gendoc.t.
2015-12-17 22:29:41 +09:00
Matt Mackall
48434b4246 dirstate: make delaywrite sleep until the next multiple of n seconds
Rather than sleep for 2 seconds, we sleep until the next even-numbered
second, which has the same effect, but makes tests faster. This
removes test-largefiles-update as the long pole of the test suite.
2015-12-16 20:58:26 -06:00
Matt Mackall
476828ae86 dirstate: only invoke delaywrite if relevant
This avoids a significant amount of sleeping in some of our longest
tests.
2015-12-16 20:49:18 -06:00
Matt Mackall
105f68a336 dirstate: move delaywrite logic from write to _write
This will allow us to be smarter in upcoming patches.
2015-12-16 20:46:53 -06:00
Matt Mackall
1a6d366c07 run-tests: show scheduling with --showchannels
This gives one line of output per second with one column per -j level
that allows analyzing test scheduling problems. First 24 seconds of
output at -j 30 looks like this:

  0                                                                .
  1  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   s.
  2  c c o c r l g r s s = c p = c h c a h c g c h c b c c l l c   ss
  3  h o b o e a e u u u c o a h o e o c g o l h g h u o = a o =   s
  4  e n s n b r n n b b   m t g n l n l w n o e w e n n e r g i   .
  5  c t o = a g d - r r = m c w v p v . e v g c e c d v x g . m
  6  k r l r s e o t e e b a h e e . e . b e . k b k l e t e . p
  7  - i e e e f c e p p u n b b r . r . - r . - - - e r e f . o   .
  8  p b t v - i . s o o n d o d t . t . c t . c s = 2 t n i . r
  9  y - e s c l . t - . d - m i - . - . o - . o y r - - s l . t
 10  3 p - e h e . s s . l t b r s . s . m s . d m e f s i e . .
 11  - e c t e s . . v . e e . . v . v . m v . e r n o v o s . .
 12  c r h . c - . . n . 2 m . . n . n . a n . . e a r n n . . .
 13  o f e . k u . . . . - p . . - . - . n - . . v m m - . . . .
 14  m . c . - p . . . . e l . . s . m . d s . . . e a e . . . .
 15  p . k . r d . . . . x a . . i . o . s o . . . - t n . . . .
 16  a . h . e a . . . . c t . . n . v . . u . . . m . c . . . .
 17  t . e . s t . . . . h e . . k . e . . r . . . e . o . . . .
 18  . . a . t e . . . . a . . . . . . . . c . . . r . d . . . .
 19  . . d . o . . . . . n . . . . . . . . e . . . g . i . . . .
 20  . . s . r . . . . . g . . . . . . . . . . . . e . n . . . .
 21  . . . . e . . . . . e . . . . . . . . . . . . 2 . g . . . .
 22  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
 23  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   .
 24  . . . . . . . . . . . . . . . . . . . . . . . . . = . . . .   ^C

Test names read off vertically, beginning with '='. Idle time (not
shown) appears as blank space.
2015-12-07 16:16:06 -06:00
Matt Mackall
830377c397 tests: avoid duplicate install steps in test-run-tests
At several seconds each, this is significantly slowing down the test.
2015-12-06 15:14:01 -06:00
Matt Mackall
c4ab4cefae run-tests: add more scheduling weight hints
The scheduler would like to order test execution by expected run-time,
but doesn't know much about how long a test will run. It thus uses
test size as a proxy for run-time. By tweaking these weights we can
keep CPUs more evenly busy and thus finish sooner.

In particular, this change pushes the three currently longest-running
tests closer to the beginning:

test-largefiles-update.t
test-run-tests.t
test-gendoc.t

As the largefiles test is currently the long pole of the test suite
with higher -j factors, the sooner it's started, the sooner the tests
can end.

We also up the weight on some shorter but long-running tests that
could have previously delayed completion with low -j factors by
running very close to the end.
2015-12-04 17:05:20 -06:00
Matt Mackall
8d86df8f01 run-tests: report timeouts in a less alarming fashion
Rather than report timed-out tests like this:

 ERROR: test-convert-svn-sink.t output changed
 !

..simply put a 't' rather than a '.' in the stream.
2015-12-04 14:55:10 -06:00
Matt Mackall
e9718e4615 merge with stable 2015-12-16 17:40:01 -06:00
timeless
4eb5187268 import: reorder help text
Try to place key concepts early+together.
2015-12-15 07:57:04 +00:00
timeless
ff823e878b import: add word to help text 2015-12-15 07:56:03 +00:00
timeless
a16cbf7613 import: refactor exact flag 2015-12-15 07:54:01 +00:00
timeless
8e17ef3397 help: filter extension commands 2015-12-14 05:29:55 +00:00
timeless
37c2440209 test-help: tighten grep patterns
Help should output section headings, but no debug commands
2015-12-14 06:00:32 +00:00
Laurent Charignon
4309e7ad61 summary: add troubles list to the output of hg summary
This patch adds troubles information to the output of hg summary.
Example line displayed in hg summary:
unstable: 1 changeset
2015-12-14 11:19:48 -08:00
Matt Mackall
bfb407a6ed wix: add missing template 2015-12-16 17:17:12 -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
liscju
ab17d6f05d rebase: add returning value from pullrebase function
So far pullrebase function has always returned None value, no matter
what orig function returned. This behaviour made impossible for
pull to change returned value from mercurial process (it has always
ended with 0 value by default). This patch makes pullrebase returning
with returned value from orig.
2015-11-15 22:18:48 +01:00
Siddharth Agarwal
4e11ac7ea5 resolve: restore .orig only after merge is fully complete (issue4952)
Previously, we'd restore the .orig file after the premerge is complete but
before the merge was complete. This would lead to the .orig file potentially
containing merge conflict markers in it, as a leftover from the last merge
attempt.
2015-11-13 15:56:02 -08:00
Gregory Szorc
c1d73b49e9 tags: create new sortdict for performance reasons
sortdict internally maintains a list of keys in insertion order. When a
key is replaced via __setitem__, we .remove() from this list. This
involves a linear scan and array adjustment. This is an expensive
operation.

The tags reading code was calling into sortdict.__setitem__ for each tag
in a read .hgtags revision. For repositories with thousands of tags or
thousands of .hgtags revisions, the overhead from list.remove()
noticeable.

This patch creates a new sortdict() so __setitem__ calls don't incur a
list.remove.

This doesn't appear to have any performance impact on my Firefox
repository. But that's only because tags reading doesn't show up in
profiles to begin with. I'm still waiting to hear from a user with over
10,000 tags and hundreds of heads on the impact of this patch.
2015-11-12 13:16:04 -08:00
FUJIWARA Katsunori
3536b81882 share: wrap bmstore._writerepo for transaction sensitivity (issue4940)
4bc805f938a0 made 'bmstore.write()' transaction sensitive, to restore
original bookmarks correctly at failure of a transaction.

For example, shelve and unshelve imply steps below:

  before 4bc805f938a0:
    1. move active bookmark forward at internal rebasing
    2. 'bmstore.write()' writes updated ones into .hg/bookmarks
    3. rollback transaction to remove internal commits
    4. restore updated bookmarks manually

  after 4bc805f938a0:
    1. move active bookmark forward at internal rebasing
    2. 'bmstore.write()' doesn't write updated ones into .hg/bookmarks
       (these are written into .hg/bookmarks.pending, if external hook
       is spawn)
    3. rollback transaction to remove internal commits
    4. .hg/bookmarks should be clean, because it isn't changed while
       transaction running: see (2) above

But if shelve or unshelve is executed in the repository created with
"shared bookmarks" ("hg share -B"), this doesn't work as expected,
because:

  - share extension makes 'bmstore.write()' write updated bookmarks
    into .hg/bookmarks of shared source repository regardless of
    transaction activity, and

  - intentional transaction failure at the end of shelve/unshelve
    doesn't restore already updated .hg/bookmarks of shared source

This patch makes share extension wrap 'bmstore._writerepo()' instead
of 'bmstore.write()', because the former is used to actually write
bookmark changes out.
2015-11-13 02:36:30 +09:00
Danek Duvall
d23d8113a8 test: test-bundle-type.t needs to work more universally
The cut and head utilities on Solaris have weird differences from the GNU
versions.  The f helper script does a dump more nicely than those tools,
anyway.
2015-11-10 09:58:10 -08:00
Matt Mackall
9b4fd50e2e Added signature for changeset ec7a5e1a55ed 2015-11-09 16:24:13 -06:00
Matt Mackall
2dd39095d7 posix: fix test-permissions regression 2015-11-09 15:53:11 -06: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
Mateusz Kwapich
266a6f869e dirstate: fix filefoldmap incosistency on file delete
The _filefoldmap is not updated in when files are deleted from dirstate. In the
case where the file with the same but differently cased name is added afterwards
it renders _filefoldmap incorrect.  Those steps must occur to for a problem to
reproduce:
 - call status (with listunknown=True),
 - update working rectory to a commit which does a casefolding change (A -> a)
 - call status again (it will show the file "a" as deleted)

Unfortunately I'm unable to write a test for it because I don't know any
core-mercurial command able to reproduce those steps.

The bug was originally spotted when hgwatchman was enabled. It caused the
changeset contents change during hg rebase (one file unrelarted to changeset
was deleted in it after rebase).

The hgwatchman is able to hit it because when hgignore changes the hgwatchmans
overridestatus is calling original status with listunknown=True.
2015-11-09 10:43:23 -08:00
Steve Borho
e04f287b5a wix: style-coal.css has been renamed 2015-11-09 09:41:20 -06:00
Javi Merino
65fb643f36 clonebundles: fix typo s/comand/command/ 2015-11-05 10:31:20 +00:00
Matt Mackall
8b9a3d960f posix: retry on symlink race in checklink
Multiple threads might attempt to check links with the same temporary
name. This would cause one side to get an EEXIST error and wrongly
fail the support check. Here, we simply retry if our temporary name
exists.
2015-11-06 15:23:10 -06:00
Pierre-Yves David
f89772113f changegroup: back code change of b5988e1d3dcb out
The previous changeset is a simpler way of fixing issue4934 without changing the
spirit of the code. We can remove the dual call to 'delayupdate' but we keep the
tests to show that the issue is still fixed.
2015-11-06 13:01:15 -05:00
Pierre-Yves David
dfd6e44ebe changegroup: call 'prechangegroup' hook before setting up write delay
The 'prechangegroup' interfere with 'delayupdate' logic because it trigger the
one time call of 'changelog._writepending' (see issure4934). There is no reason
not to call that hook before setting up 'delayupdate' so we move the call a bit
earlier to avoid interference.
2015-11-06 12:59:09 -05:00
Pierre-Yves David
107254a73d changegroup: fix the scope of a try finally
The try finally is here to ensure we release the just-created transaction.
Therefore we should not do half a dozen operations before actually entry the try
scope.
2015-11-06 12:39:06 -05:00
Yuya Nishihara
44b7401396 demandimport: fix level passed to loader of sub-modules
As the fromlist gives the names of sub-modules, they should be searched in
the parent directory of the package's __init__.py, which is level=1.

I got the following error by rewriting hgweb to use absolute_import, where
the "mercurial" package is referenced as ".." (level=2):

  ValueError: Attempted relative import beyond toplevel package

I know little about the import mechanism, but this change seems correct.
Before this patch, the following code did import the os module with no error:

  from mercurial import demandimport
  demandimport.enable()
  from mercurial import os
  print os.name
2015-11-01 21:19:09 +09:00
Yuya Nishihara
557c963f7b parsers: fix width of datalen variable in fm1readmarkers
Because parsers.c does not define PY_SSIZE_T_CLEAN, "s#" format requires
(const char*, int), not (const char*, Py_ssize_t).

https://docs.python.org/2/c-api/arg.html

This error had no problem before 7d13be5f72c2, where datalen wasn't used.
But now fm1readmarkers() fails with "overflow in obsstore" on Python 2.6.9
(amd64) because upper bits of datalen seem to be filled with 1, making it
a negative integer.

This problem seems not visible on our Python 2.7 environment because upper
bits happen to be filled with 0.
2015-11-07 17:43:20 +09:00