Commit Graph

1078 Commits

Author SHA1 Message Date
Tony Tung
e749cff990 [fastmanifest] ui.log's msg[0] must be a format string
Summary:
Since metrics doesn't send a string, let's just stub out the call.

The alternative is to put a '' in every `recordsample()` call.

Test Plan: pass existing tests.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3479138

Tasks: 11900487

Signature: t1:3479138:1466787619:910917093cf0361ed181af5597ab702b936f8d1e
2016-06-24 16:17:56 -07:00
Tony Tung
8f18f9f0be [fastmanifest] test to verify the behavior of the background cache worker
Summary:
1. verify that we cache entries on background.
2. verify that we don't fill the cache when we can't take the lock.

Test Plan: passed existing unit tests.

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3471355

Signature: t1:3471355:1466719450:191070cd2d5ef93e0e1a6925a04d1a885431cbb4
2016-06-24 16:17:40 -07:00
Tony Tung
c89f8dcf7e [fastmanifest] add the ability for waitforfile.py to wait for a file to materialize
Summary: --created is the opposite of --deleted.

Test Plan: meh.  used in later diff.

Reviewers: lcharignon, mjpieters

Reviewed By: mjpieters

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3478780

Signature: t1:3478780:1466759469:47a3af68df2c8d550aa654f135d4f0fcf6df7851
2016-06-24 16:17:18 -07:00
Tony Tung
d24d1c4c86 [fastmanifest] fix incorrect table label
Summary: It's actually most relevant to least relevant.  Add a docblock.

Test Plan: pass unit tests

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3478616

Signature: t1:3478616:1466787566:b38eceddf91c3e88341f9173e07244ac33ab6345
2016-06-24 16:13:39 -07:00
Tony Tung
1060bda026 [fastmanifest] update comment to reflect the ugly truth
Test Plan: it's a comment

Reviewers: durham, mitrandir, rmcelroy, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3478159

Signature: t1:3478159:1466787557:90af1e7c952e3b1ecb4b9b07fbc5613ca7940f3a
2016-06-24 16:13:21 -07:00
Mateusz Kwapich
b6ab06f7a2 sqldirstate: fast in-memory cache for batch operations
Summary:
To fix sqldirstate perf in case of iterating through whole
dirstate we are introducing the possibility to cache it in memory when
neccessary.

Currently we are doing it only in the case when dirstate.walk() is called.

Test Plan:
    ./run-sqlitedirstate-test.py --hg ~/clowncopter/ -j 30 -t 1200
    ~/clowncopter/tests/run-tests.py -j 30

Reviewers: #mercurial, durham, ttung, lcharignon

Reviewed By: lcharignon

Subscribers: lcharignon, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3472402

Signature: t1:3472402:1466807592:a28bc4662cc157547b8b747c6be98faae35c63b5
2016-06-24 15:48:40 -07:00
Tony Tung
9be947d39d [fastmanifest] remove reference to manifestv2 method that doesn't even exist
Test Plan: meh.

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3471437

Tasks: 11375833

Signature: t1:3471437:1466694929:7ffd83b43fd5c45850f6c265bf305dc6bf199b20
2016-06-23 13:42:30 -07:00
Tony Tung
520195e68c [fastmanifest] rename save to _save
Summary: It's not for public consumption.

Test Plan: run `PYTHONPATH=~/work/mercurial/facebook-hg-rpms/remotenames/:~/work/mercurial/facebook-hg-rpms/mutable-history/hgext  python ~/work/mercurial/facebook-hg-rpms/hg-crew/tests/run-tests.py -j32 test-fastmanifest*.{py,t}`

Reviewers: simonfar, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3471404

Tasks: 11375421

Signature: t1:3471404:1466694921:2ec80e6ca3b460cc42cc766af96d9551f9100c75
2016-06-23 13:42:24 -07:00
Tony Tung
e47030aa54 [fastmanifest] script to wait for a file to be deleted
Summary: This allows us to build tests to verify the behavior of background cache fills.

Test Plan: used in next diff.

Reviewers: mjpieters, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D3471343

Tasks: 11683504

Signature: t1:3471343:1466698914:93d15b2d4879b9d8a91aeab62fcf119f24de3c1c
2016-06-23 13:41:52 -07:00
Tony Tung
8ff74cf5be [fastmanifest] remove fork_worker
Summary:
Don't need it any more!!

Depends on D3468828

Test Plan: meh

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3468848

Tasks: 11683504

Signature: t1:3468848:1466694940:c3a7190d064914a6b8ad24809aae7016bb3b8433
2016-06-23 13:41:46 -07:00
Tony Tung
ba0aeedd8d [fastmanifest] use with: syntax for locking
Summary:
Since we no longer need to unlock in only one fork, we can use the `with lock() as xxx:` syntax

Depends on D3468830

Test Plan: pass existing unit tests

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3468832

Tasks: 11683504

Signature: t1:3468832:1466694908:6e1d3beff673df5b70ece250af72ad9be66545a6
2016-06-23 13:41:40 -07:00
Tony Tung
e57eb41517 [fastmanifest] spawn a secondary process to cache manifests
Summary:
Introduce a cacher class, which encapsulates all the logic for actually caching manifests.  Triggers can either directly invoke cacher, or invoke `hg cachemanifest`, which then calls cacher.

Depends on D3468828

Test Plan: pass existing unit tests

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3468830

Tasks: 11683504

Signature: t1:3468830:1466695022:9a470fcb06badd9e90931cd931a945e8039d71ea
2016-06-23 13:41:33 -07:00
Tony Tung
f8e2cffbae [fastmanifest] get rid of --background
Summary:
Everything will be synchronous within the process.  We will do background work in a separate process.

Depends on D3468827

Test Plan: updated tests to remove the one background task.

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3468828

Tasks: 11683504

Signature: t1:3468828:1466694717:556968a10717c3dd7ce403593cc6a1e97067633f
2016-06-23 13:41:26 -07:00
Tony Tung
da6102043b [fastmanifest] support for non-silent workers
Summary:
We want to be able to dump debugging output for the workers.

Depends on D3468818

Test Plan: used in later diffs.

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters, #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D3468827

Tasks: 11683504

Signature: t1:3468827:1466695135:bb930ac6e34f3654a7006634c22dc99b3d2e75bf
2016-06-23 13:41:18 -07:00
Tony Tung
2eb056bf8e [fastmanifest] don't use shell=True
Test Plan: none

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3468818

Tasks: 11683504

Signature: t1:3468818:1466695146:9bd98efec59fced0d99f712b7a1e4b855e6ae93e
2016-06-23 13:40:12 -07:00
Tony Tung
ac63bda69a [fastmanifest] copy runshellcommand from remotefilelog
Test Plan: NONE WHATSOEVER.

Reviewers: durham, lcharignon

Reviewed By: lcharignon

Subscribers: rmcelroy, quark, mitrandir, mjpieters, #mercurial

Differential Revision: https://phabricator.intern.facebook.com/D3468816

Tasks: 11683504

Signature: t1:3468816:1466694675:7d5d08e0be9eae0e4b45662c637482d1f6de6ce1
2016-06-23 13:34:15 -07:00
Mateusz Kwapich
7080a2c0c0 sqldirstate: move initialization to extsetup
Summary: That is neccesary for this to work with extorder.

Test Plan: ~/clowncopter/tests/run-tests.py -j 30

Reviewers: #mercurial, ttung, durham, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3472367

Signature: t1:3472367:1466633447:8b5af3f546be9d1f3634882f9638cfe5feb6c181
2016-06-23 11:32:18 -07:00
Mateusz Kwapich
c31ecacde9 enable extorder extension in setup.py
Summary: I plan to use it to ensure proper loading ordr in case of sqldirstate

Test Plan:
    ~/clowncopter/tests/run-tests.py -j 30

Reviewers: #mercurial, ttung, durham, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3472358

Signature: t1:3472358:1466637677:3b8b5a89ef7dfbcde4a1e7b8ea58348b07a6a969
2016-06-23 11:32:11 -07:00
Mateusz Kwapich
d9ed107003 sqldirstate: speed up the copy method by avoiding iteration
Summary: The iteritems makes sure that we do one big query instead of a query per item.

Test Plan:
    ./run-sqlitedirstate-test.py --hg ~/clowncopter/ -j 30 -t 1200
    ~/clowncopter/tests/run-tests.py -j 30

Reviewers: #mercurial, durham, ttung

Reviewed By: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3472343

Signature: t1:3472343:1466642757:d29c569b718fbfbf2c9b030467f9a262c0c4078b
2016-06-23 11:32:04 -07:00
Mateusz Kwapich
70f48203f7 nointerrupt: introduce extension
Summary:
This extensions prevents mercurial from being ctrl-c'ed by warning the
user on the first SIGINT. The subsequent interrupts are handled normally.

Test Plan:
see tests

(the tests are lacking the scenario of double ctrl-c - any suggestions on how
to do it in nice way inside the test framework welcome)

Reviewers: #sourcecontrol, durham, wez, quark, akushner, rmcelroy

Subscribers: lcharignon, quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D2936488
2016-06-23 11:30:36 -07:00
Tony Tung
f1b5405ae9 [sampling] rename HG_SAMPLING_FILEPATH to SCM_SAMPLING_FILEPATH
Summary: The scm wrappers is agnostic of which scm.  Technically, we could implement the same functionality in git.

Test Plan: run with the wrappers

Reviewers: lcharignon

Reviewed By: lcharignon

Subscribers: mitrandir, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3465938

Signature: t1:3465938:1466550871:912a627d114961b76ef605c89ccfcc75b6665664
2016-06-22 00:06:52 -07:00
Adam Simpkins
33cf8f401d [tweakdefaults] stop running xargs+grep through a shell
Summary:
Directly execute the xargs command, rather than using a shell.  This is
slightly more efficient, but also ensures we won't have security problems or
other issues based on the user's grep.command config setting.  Even if it
contains shell redirects, semicolons, or other special characters, we will no
longer pass them to a shell to interpret them.

We do use shlex.split() go process the grep.command setting, to allow the user
to specify a command plus arguments.

Test Plan: Included new unit tests.

Reviewers: #sourcecontrol, durham, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: akushner, rmcelroy, sid0, net-systems-diffs@, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3376617

Signature: t1:3376617:1464841542:f58fc0a05d62b649edc70bc261009875385186c9
2016-06-21 20:44:08 -07:00
Adam Simpkins
a25e35bc50 [tweakdefaults] fix handling of grep file pattern arguments
Summary:
Previously grep only searched in the current directory, even if you gave it a
pattern like "../".  This fixes the code to correctly honor the arguments, and
to accept mercurial file patterns just like most other mercurial commands.

This does change the file parsing behavior somewhat: previously "hg grep" would
treat all arguments as glob patterns.  Now you explicitly have to say
"glob:<pattern>" to get glob matching.  However, I suspect this won't impact
most users, since they would normally let their shell perform glob expansion
before the arguments are given to mercurial.

Test Plan:
Included new unit tests for grep, and updated the existing tests that were
affected by the change in glob behavior.

Reviewers: #sourcecontrol, durham, carenthomas, ttung, rmcelroy

Reviewed By: rmcelroy

Subscribers: quark, mwilliams, matthieu, meyering, yfeldblum, rmcelroy, net-systems-diffs@, yogeshwer, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3376605

Signature: t1:3376605:1464841648:98bfb47866dec802ca34f55c821796f36532211f
2016-06-21 20:44:06 -07:00
Laurent Charignon
e9b8bf6ba5 fastmanifest: fix sampling
Summary:
This patch fixes various things around the sampling extension to
match what our wrapper expects to see. See detail in the test.

Test Plan:
        lcharignon@XXX fbsource cat ~/.hgrc
        ...
        [extensions]
        sampling=
        [sampling]
        key.fastmanifest-cachehitratio=table_blah
        key.fastmanifest-trigger=table_blah
        filepath=/dev/shm/samppath


        lcharignon@XXX fbsource hhg book foo

        lcharignon@XXX fbsource cat /dev/shm/samppath
        {"category": "table_blah", "data": {"source": "bookmark", "metrics_type":
        "fastmanifest-trigger"}}\0{"category": "table_blah", "data": {"ratio": -1, "metrics_type":
        "fastmanifest-cachehitratio"}}\0

Reviewers: ttung, durham

Differential Revision: https://phabricator.intern.facebook.com/D3466719
2016-06-21 17:07:55 -07:00
Laurent Charignon
3542154d80 fastmanifest: fix logic bug in the cache
Summary:
This patch adds a test that uncovers logic bugs in the cache. It also
adds fixes for these bugs.

Test Plan:
Add a new test and ran existing tests, observed no change for
exisiting test.

Reviewers: durham, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3450430
2016-06-21 17:07:46 -07:00
Laurent Charignon
a046127556 fbhistedit: add args and kwargs to torule
Summary: This patch fixes the torulemethod of the exec action to match upstream.

Test Plan: Add a test that failed before the codechange

Reviewers: mitrandir

Differential Revision: https://phabricator.intern.facebook.com/D3459588
2016-06-21 14:03:46 -07:00
Martijn Pieters
5b77967854 Backed out changeset 0aa2b8139243
Summary:
The upstream change has now been *properly* landed at
https://selenic.com/repo/hg//rev/6ee50bdeeb32.

Once again, Mea Culpa, yesterday I apparently was in clowntown mode with these
patches.

Test Plan:
Run all affected tests:

  $HGSRC/tests/run-tests.py -l test-pull-createmarkers* test-pushrebase* test-pushvars*

Reviewers: #sourcecontrol, ttung, quark

Reviewed By: quark

Subscribers: mjpieters, durham

Differential Revision: https://phabricator.intern.facebook.com/D3462832

Signature: t1:3462832:1466513182:58d6187c04e0e567a026aba90bf753c76f4949a7

Blame Revision: D3460645
2016-06-21 13:58:55 +01:00
Durham Goode
ec171a5a29 backout: backout e61bd9d5e8ca about file descriptor cache
Summary:
e61bd9d5e8ca requires a change to core that has been accepted but not yet
pushed. This breaks the build, so let's revert it until upstream pushes the
dependency.

Test Plan: Ran the tests

Reviewers: ttung, mjpieters, #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3460645

Signature: t1:3460645:1466465904:cd521a989e475f9987237307a7d4d672d58ba615
2016-06-20 16:38:48 -07:00
Jun Wu
f29efc11b8 setup: build patchpython extension
Summary: We need to add `patchpython` to `setup.py` so it can get built.

Test Plan: `make local`

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3456715
2016-06-20 14:06:37 +01:00
Martijn Pieters
d5cd8b6937 Add missing imports, fix line lengths
Summary:
This file clearly predates linting, if `hookargs` is ever set to `None` a
`NameError` would be triggered here.

Test Plan:
Run all affected tests:

  $HGSRC/tests/run-tests.py -l test-pull-createmarkers* test-pushrebase* test-pushvars*

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3456417
2016-06-20 12:12:32 +01:00
Martijn Pieters
08afaea81e Get rid of getfilecache now that it is no longer needed
Summary:
Now that my upstream patch for filedescriptor class access has landed the helper function to bypass the descriptor protocol can go altogether.

Depends on D3454878

Test Plan:
Run affected extension tests:

  $HGSRC/tests/run-tests.py -l test-sqldirstate-* test-reflog* test-sparse*

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3456368
2016-06-20 12:12:32 +01:00
Martijn Pieters
9b160b48c6 Use one function to access the filecache descriptor, and wrapfunction to patch
Summary:
There were 3 clowntowny versions of the wrapfiledescriptor function, 2 being
dangerously wrong about how they scan the class hierarchy. All because
`classobj.descriptorname` invokes the descriptor protocol and the filecache
descriptor is not set up for that access.

Instead of one function to do it all, use one utility function to retrieve
the descriptor object from the class __dict__ to avoid the descriptor protocol
kicking in, and use mercurial.extensions.wrapfunction to do the actual
wrapping.

I've sent a patch upstream to fix accessing the filecache descriptor on the
class; if accepted we can drop the getfilecache utility function altogether,
leaving only the wrapfunction calls.

Test Plan:
Run affected extension tests:

   $HGSRC/tests/run-tests.py -l test-sqldirstate-* test-reflog* test-sparse*

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3454878
2016-06-20 12:12:32 +01:00
Durham Goode
fb442c3ae1 tests: fix lint error 2016-06-17 14:54:22 -07:00
Laurent Charignon
314c1245bf fastmanifest: refactor of the fastmanifest cache
Summary:
This diff refactors the fastmanifest cache. Main differences introduced:
- We use python magic methods to access the cache (__getitem__, __contains__, ...)
- The cache is separated in two classes: ondiskcache and fastmanifestcache, the
  former handles all the I/O, the latter handles the cache hierarchy and logic.
  This allows to better group I/O related operations and make it easier to reason
  about the code.
- By default we use systemawarecachelimit when creating a cache instead of no
  limit before.
- The code is simpler to understand, the interface is cleaner: we only use
  manifest nodes not a mix of filepath, manifestnodes and cachekeys.

Test Plan: test output does not change

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3427797
2016-06-17 09:35:39 -07:00
Laurent Charignon
dcc7566c33 fastmanifest: allow creating a systemawarecachelimit without a reference to repo
Summary: This will be useful to refactor the cache

Test Plan:
We change the python test to give a vfs that makes sense, it will
be useful in the next patch when we refactor the cache. Indeed, with the new
cache we use systemawarecachelimit by default instead of no limit

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3427796
2016-06-17 09:35:39 -07:00
Laurent Charignon
ef584cd5fe fastmanifest: change entry removal order
Summary:
Before this patch, if we decided to remove entries A,B,C where A is
more recent than B, which in turn is more recent than C. We were removing
in order A,B and C. This patch changes the order to C,B and A and will make
the next patches simpler.

Test Plan: Tests are updated accordingly

Reviewers: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3427795
2016-06-17 09:35:39 -07:00
Laurent Charignon
f1ab577b18 fastmanifest: add a debug line when refreshing cache entry
Summary:
When refreshing cache entries, it is useful to know what delay we
introduce. This patch adds a debug line showing that information.

Test Plan: tests are updated accordingly

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3427794
2016-06-17 09:35:39 -07:00
Laurent Charignon
21923d4d76 fastmanifest: better --list debug output
Summary:
Before this patch, it wasn't clear from hg debugcachemanifest --list
which manifest were older and newer or what rev were actually cached. This
patch improves the output of hg debugcachemanifest --list --debug to show
this information.

Test Plan: add debug output to the test

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3427791
2016-06-17 09:35:39 -07:00
Laurent Charignon
5835cbc55c fastmanifest: make __iter__ return the cache entries in a sound order
Summary:
Before this patch we were returning the cache entries alphabetically.
This patch changes the behavior to return the entries sorted by date and
alphabetically. This will be used to simplify the code for pruning entries
in furter patches.

Test Plan: test output changes

Reviewers: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3427789
2016-06-17 09:35:39 -07:00
Kostia Balytskyi
1d18a2690a fbamend: abort if preamend bookmark points to the current commit
Differential Revision: https://phabricator.intern.facebook.com/D3436696
2016-06-17 05:25:32 -07:00
Durham Goode
f7d38f2065 fb-hgext: disable system watchman config in tests
The system watchman config can interfere with test runs, so let's disable it via
the environment variable.
2016-06-16 18:56:37 -07:00
Jeroen Vaelen
f10fd61efd [fb-hgext] use hashlib to compute sha1 hashes
Summary:
hg-crew's c27dc3c3122 and c27dc3c3122^ were breaking our extensions:

```
$ hg log -r c27dc3c3122^
changeset:   9010734b79911d2d2e7405d91a4df479b35b3841
user:        Augie Fackler <raf@durin42.com>
date:        Thu, 09 Jun 2016 21:12:33 -0700
s.ummary:     cleanup: replace uses of util.(md5|sha1|sha256|sha512) with hashlib.\1
```

```
$ hg log -r c27dc3c3122
changeset:   0d55a7b8d07bf948c935822e6eea85b044383f00
user:        Augie Fackler <raf@durin42.com>
date:        Thu, 09 Jun 2016 21:13:23 -0700
s.ummary:     util: drop local aliases for md5, sha1, sha256, and sha512
```

I did a grep over facebook-hg-rpms to see what was affected:
```
$ grep "util.\(md5\|sha1\|sha256\|sha512\)" -r ~/facebook-hg-rpms
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/basestore.py:            sha = util.sha1(filename).digest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/basestore.py:                sha = util.sha1(filename).digest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/shallowutil.py:    pathhash = util.sha1(file).hexdigest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/shallowutil.py:    pathhash = util.sha1(file).hexdigest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/debugcommands.py:    filekey = util.sha1(file).hexdigest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/historypack.py:        namehash = util.sha1(name).digest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/historypack.py:        node = util.sha1(filename).digest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/historypack.py:        files = ((util.sha1(filename).digest(), offset, size)
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/fileserverclient.py:    pathhash = util.sha1(file).hexdigest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/fileserverclient.py:    pathhash = util.sha1(file).hexdigest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/remotefilelog/basepack.py:        self.sha = util.sha1()
/home/jeroenv/facebook-hg-rpms/remotefilelog/tests/test-datapack.py:        return util.sha1(content).digest()
/home/jeroenv/facebook-hg-rpms/remotefilelog/tests/test-histpack.py:        return util.sha1(content).digest()
Binary file /home/jeroenv/facebook-hg-rpms/hg-crew/.hg/store/data/mercurial/revlog.py.i matches
Binary file /home/jeroenv/facebook-hg-rpms/hg-crew/.hg/store/data/contrib/mercurial.spec.i matches
/home/jeroenv/facebook-hg-rpms/hg-crew/contrib/mercurial.spec:%global docutilsmd5 4622263b62c5c771c03502afa3157768
/home/jeroenv/facebook-hg-rpms/hg-crew/contrib/buildrpm:    DOCUTILSMD5=`sed -ne "s/^%global docutilsmd5 //p" $specfile`
/home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py:            return util.sha1(fh.read()).hexdigest()
/home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py:        sha1 = util.sha1()
/home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py:        sha1 = util.sha1()
/home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py:        sha1 = util.sha1()
/home/jeroenv/facebook-hg-rpms/fb-hgext/sparse.py:    sha1 = util.sha1()
/home/jeroenv/facebook-hg-rpms/mutable-history/hgext/simple4server.py:        sha = util.sha1()
/home/jeroenv/facebook-hg-rpms/mutable-history/hgext/evolve.py:        sha = util.sha1()
```

This diff is part of the fix.

Test Plan:
Ran the tests.
```
$MERCURIALRUNTEST -S -j 48 --with-hg ~/local/facebook-hg-rpms/hg-crew/hg
```
There was still one failure, but that's due to the fact that my locally built hg does not have lz4revlog.

Reviewers: #sourcecontrol, durham, ttung

Reviewed By: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3438597

Tasks: 11762191

Signature: t1:3438597:1466016473:d33de5a2c772d17724429d3607e2400c85618c71
2016-06-15 12:05:38 -07:00
Durham Goode
b9e78ae8c1 statprof: add threading sampler
Summary:
The existing statprof uses signals to perform stack sampling. Those signals can
interfere with system calls though. This patch introduces a way of using python
threads to perform sampling from a background thread.

This also changes the default to be the threaded profiler instead of the
sampling one, since the sampling can crash the proces sometimes.

In some situations this produces a more accurate stack trace.

Test Plan:
```
sudo cp statprof.py /usr/lib64/python2.6/site-packages/statprof.py
hg pull --profile
# Verified I got output and that it was different from the old statprof (it was
# more accurate, as compared with time.time() measurements in the code)
```

Reviewers: #mercurial, ttung, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3402864

Signature: t1:3402864:1465978363:c8455d119cc03c2c475e190aee28587a9d434c4d
2016-06-15 09:54:18 -07:00
Durham Goode
50238ee029 statprof: make unimportant functions gray
This will help highlight which functions actually had work, and which were just
calling down to another function.
2016-06-14 12:58:27 -07:00
Laurent Charignon
69afc55b3b fastmanifest: fail gracefully when we cannot compute cache limit
Summary:
Before this patch if the path was not accessible we would fail to
compute the limit.

Test Plan:
We should test systematically all these kind of issues, I am doing
a refactoring that will allow us to do that.

Reviewers: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3424996
2016-06-13 15:26:55 -07:00
Laurent Charignon
1e1c21421b fastmanifest: don't stop when we cannot get the lock
Summary:
Before this patch we were stopping execution when the lock couldn't
be taken. This was problematic when running hg command for someone else's repo
(for example to debug problems). This patch allows us to continue the execution
of the command when that happen, except we won't use fastmanifest.

Test Plan: This is reflected in the test output

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3422458
2016-06-13 15:26:55 -07:00
Laurent Charignon
f6986bb23e fastmanifest: prevent error when renaming cache entry
Summary: This could break people using fastmanifest in someone else's repo

Test Plan: tests pass, not sure how we normally test permission stuff

Reviewers: ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3420870
2016-06-13 15:26:55 -07:00
Laurent Charignon
5987cca652 fastmanifest: prevent error when creating cache folder with missing permissions
Summary:
Before this patch we would have error using fastmanifest on repos you
didn't own.

Test Plan: tests pass

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3420863
2016-06-13 15:26:55 -07:00
Laurent Charignon
cf676f04b4 fastmanifest: remove unused, duplicated line
Summary: This line shouldn't be there

Test Plan: tests pass

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3420857
2016-06-13 15:26:55 -07:00
Kostia Balytskyi
36e90d0fed tweakdefaults: make rebaseskipobsolete behave in a more expected way
Differential Revision: https://phabricator.intern.facebook.com/D3341324
2016-06-11 15:25:13 -07:00