Commit Graph

27619 Commits

Author SHA1 Message Date
Bryan O'Sullivan
4b7071051f with: use context manager for wlock in qrefresh 2016-01-15 13:14:47 -08:00
Bryan O'Sullivan
e826ea566e with: use context manager for wlock in qpop 2016-01-15 13:14:47 -08:00
Bryan O'Sullivan
4003062696 with: use context manager for wlock in qpush 2016-01-15 13:14:47 -08:00
Bryan O'Sullivan
68786b4a3e with: use context manager for wlock in qnew 2016-01-15 13:14:47 -08:00
Bryan O'Sullivan
e41ff99cd6 with: use context manager for wlock in mergeupdate 2016-01-15 13:14:47 -08:00
Bryan O'Sullivan
ab04c813f9 with: use context manager for wlock in overridepurge 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
070b1b5491 with: use context manager for wlock in cmdutilforget 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
b83485ed82 with: use context manager for wlock in overriderevert 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
3538da229b with: use context manager for wlock in removelargefiles 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
ccc94927e6 with: use context manager for wlock in addlargefiles 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
c7a59c74b6 with: use context manager for wlock in updatelfiles 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
65ee17ba0b with: use context manager for wlock in kw_dorecord 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
a9fe3cefa5 with: use context manager for wlock in kw_copy 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
85a3bcab4f with: use context manager for wlock in kw_amend 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
6b60d65449 with: use context manager for wlock in keyword demo 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
82870250ec with: use context manager for wlock in _kwfwrite 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
a2f04de9b6 with: use context manager for wlock in sign 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
dc202a7844 with: use context manager for wlock in checklookup 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
c12335032a with: use context manager for wlock in copy 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
0d3b3841ab with: use context manager for wlock in workingctx.undelete 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
e93769dccc with: use context manager for wlock in workingctx.forget 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
521cb71d13 with: use context manager for wlock in workingctx.add 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
a7b2ba3a96 with: use context manager for wlock in graft 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
f5b1df9677 with: use context manager for wlock in debugsetparents 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
cb352193d4 with: use context manager for wlock in debugrebuilddirstate 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
acc88c0183 with: use context manager for wlock in copy 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
9564744e01 with: use context manager for wlock in branch 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
61f7160c5a with: use context manager for wlock in revert 2016-01-15 13:14:46 -08:00
Bryan O'Sullivan
7b94af6911 with: use context manager for wlock in remove 2016-01-15 13:14:45 -08:00
Bryan O'Sullivan
9fd07f61b7 with: use context manager for wlock in recordinwlock 2016-01-15 13:14:45 -08:00
Bryan O'Sullivan
6e36744ca3 with: use context manager for wlock in _writeactive 2016-01-15 13:14:45 -08:00
Bryan O'Sullivan
e93bfbcbd9 with: use context manager for wlock in _writerepo 2016-01-15 13:14:45 -08:00
Bryan O'Sullivan
5ea0fa6c09 sshpeer: make remotelock a context manager 2016-01-15 13:14:50 -08:00
Bryan O'Sullivan
2e67496298 lock: turn a lock into a Python context manager
This lets us greatly simply acquire/release cycles.

Code pattern before:

  try:
    lock = repo.lock()
    # zillions of lines of code
  finally:
    lock.release()

And after:

  with repo.lock():
    # ...
2016-01-15 13:14:45 -08:00
Bryan O'Sullivan
a33fafdc2a with: use context manager for I/O in changedfiles in patch 2016-01-15 13:14:50 -08:00
Bryan O'Sullivan
9c88af7c39 with: use context manager for file I/O in memusage 2016-01-15 13:14:45 -08:00
Bryan O'Sullivan
47caeb4184 i18n: don't translate a transaction name 2016-01-15 13:14:49 -08:00
Yuya Nishihara
1eaa3db7b3 chgserver: mark as a built-in extension 2015-12-23 22:37:24 +09:00
Yuya Nishihara
c4a6a3f863 chgserver: import background server extension from cHg
This extension is copied from
https://bitbucket.org/yuja/chg/ -r 86feb5f2e971

It could be imported as mercurial/chgserver.py, but in that case, we would
have to resolve circular import between chgserver and commandserver. So I
decided to keep it as an extension.

  chgserver.chgcmdserver -> commandserver.server
  commandserver._servicemap -> chgserver.chgunixservice
2015-12-23 22:23:56 +09:00
timeless
1af8764a9d check-code: export needs a space to avoid false positives 2016-01-12 15:58:59 +00:00
Laurent Charignon
d72e8db6ef rebase: small refactoring to allow better extensibility from extensions
Inhibit, one of evolve's extension, would like to change the way rebase works
with obsolete changesets. During a rebase with inhibit, the inhibition of the
obsolescence markers should be lifted for the rebase.
With this small refactoring, inhibit and can wrap the _filterobsoleterevs
function to lift inhibition cleanly and at the same time this change makes
rebases' code more legible.
2016-01-14 11:50:28 -08:00
Danek Duvall
6a2d89e5fb tests: non-GNU mv can't move a file onto a hardlink of itself
On Solaris, when you try to mv a file to another path that is a hardlink to
the original, it complains that they're identical.  GNU mv doesn't
complain, but it's simpler to just remove the original file instead.
2016-01-14 13:33:08 -08: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
Bryan O'Sullivan
dd6b32aa80 i18n: fix a test-gendoc.t failure 2016-01-14 10:31:06 -08:00
Bryan O'Sullivan
95772fe4ca test-ctxmanager: fix Python 2.6 compatibility problem 2016-01-14 09:31:03 -08:00
Bryan O'Sullivan
506a2494ba util: rename ctxmanager's __call__ method to enter 2016-01-14 09:31:01 -08:00
Laurent Charignon
b304274518 obsolete: make _computeobsoleteset much faster
This patch makes _computeobsoleteset much faster by looping
over the draft and secrets as opposed to looping over the
successors.
This works because "number of draft and secret" is typically
way smaller(<100) than the number of successor in the repo (~90k in
my checkout of core mercurial as of today). And also because
it is very fast to compute "not public()".

I timed the code with the following setup:
"""
from mercurial import hg, ui, obsolete
ui = ui.ui()
repo = hg.repository(ui, "~/hg")
l = repo.obsstore.successors # This caches the result
"""

With about 90k successors.

k=obsolete._computeobsoleteset(repo) before this patch:
10 loops, best of 3: 33.9 ms per loop

k=obsolete._computeobsoleteset(repo) after this patch:
10000 loops, best of 3: 83.3 µs per loop
2016-01-13 21:52:26 -08: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