Summary:
Before this patch, fbamend with inhibit was leaving commits behind
when using --fixup. This was because we had two separates transaction, one for
the bookmarks and one for the markers. This patchs makes the marker creation
happen in the same transaction as the bookmark move.
Test Plan: check hg amend --fixup and hg amend --rebase
https://phabricator.fb.com/P56056980
Reviewers: ericsumner, durham
Differential Revision: https://phabricator.fb.com/D2771188
Summary:
Add $WARNING to make it easier to get the original behavior (print the
`***` contact support stuff). Remove misc environment variables included
in $WARNING to make the code simpler and less dependent.
Besides, store traceback in $TRACE so that it will be easier to read it
for multiple times. For example, try to upload it (first read) and if
failed, print it locally (second read). Otherwise we need ugly hack like
`A=$(cat)` in the script.
Test Plan: Check the new examples manually and run test-errorredirect.t
Reviewers: #sourcecontrol, ttung, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2770557
Tasks: 9259456
Signature: t1:2770557:1450384683:672e76752040d3d1b440522dd54ac43306c76bf9
Summary:
Upstream commit a0f2789070ce changes the signature of `cmdutil.displaygraph`
This patch detects it and use the new signature when needed.
Test Plan: Run `hg sl` with new hg on my laptop and old hg on devserver.
Reviewers: #sourcecontrol, ttung, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D2769659
Tasks: 9446957
Signature: t1:2769659:1450376979:83f94e9bf30dea5b3c6115295ee92fdd456263af
Summary:
The old behavior would check that the cached sparse matcher was up to date by
performing a checksum on the contents of the .hg/sparse and .hg/tempsparse
files. This caused a lot of extra syscalls when sparse match was used inside a
loop.
The fix is to cache the .hg/sparse signature, and only refresh them when the
lock is acquired (similar to how most caches in Mercurial already work).
Test Plan: Ran the tests
Reviewers: #sourcecontrol, ttung, mitrandir
Reviewed By: mitrandir
Differential Revision: https://phabricator.fb.com/D2758452
Tasks: 9259321
Signature: t1:2758452:1450317072:6b0a962d336eda616cb27ef1b5e761d5153f64a3
Summary:
There were some comments under my diff after landing. Included:
* Old "Task ID" syntax
* Removing the "T" prefix
* Fixing the copypasted docstring
Test Plan: tests
Reviewers: #sourcecontrol, rmcelroy, ttung
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2765417
Signature: t1:2765417:1450294877:4a50ecfdb1fb295ffaf01ecee6fe257b52e359bc
Summary:
Verified that the issue does occur.
Verified that using `hg shelve -d my_shelve_name` works for default and arbitrary shelve name.
Test Plan: Updated the tests for githelp
Reviewers: ericsumner, durham
Reviewed By: durham
Subscribers: de-engagement-diffs@
Differential Revision: https://phabricator.fb.com/D2762983
Tasks: 7632472
Signature: t1:2762983:1450289196:f25d757d158d110e8fc5503f974170c4a9892718
Summary:
When pushing a rewritten merge commit, we were trying to look up it's original
parent in the current repo (which no longer had that commit). We need to look in
the bundle repo instead.
Test Plan: Added a test. Also tried it manually on one of the hg servers
Reviewers: #sourcecontrol, ttung, mitrandir
Reviewed By: mitrandir
Differential Revision: https://phabricator.fb.com/D2763182
Signature: t1:2763182:1450230086:c560d4b8bbfe5d5387e23c1cc2e09109f49f255b
Summary:
Devel warnings are pointing at issues in the code that need to be fixed. The
right way to get the tests to pass is to fix the warning cause, not to the
warning to the tests.
This practically backout an handful of test that added such warning output in
the test.
Test Plan:
Well, test are now broken to match the state of the borken code.
Reviewers: lcharignon
Differential Revision: https://phabricator.fb.com/D2760523
Summary: bookmarks.write is deprecated
Test Plan: The test still passes
Reviewers: ericsumner, pyd, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D2747007
Signature: t1:2747007:1449794510:09af0635c722a7aaf3b8aa444a116deaebada9b2
Summary: bookmarks.write is deprecated
Test Plan: the test is still passing
Reviewers: ericsumner, pyd, durham
Reviewed By: durham
Differential Revision: https://phabricator.fb.com/D2747002
Signature: t1:2747002:1449794465:a6ded4ed8f5249812c97cea13d9d6ce809109bd2
Summary: Our extensions dependecies are getting tricky. Let's make it right. (the logic still need to be tested - it worked on one very simple example so far).
Test Plan: no tests yet
Reviewers: pyd, lcharignon, rmcelroy
Reviewed By: rmcelroy
Subscribers: lcharignon, #sourcecontrol
Differential Revision: https://phabricator.fb.com/D2710943
Signature: t1:2710943:1449881799:16abe49529aa79df7d6ebe84a0bae0c0970b419a
Summary:
matchfn actually accepts just a single argument (the file name), so our
extramatches function was incorrect. The test didn't hit it because the matcher
had no patterns (it only had explicit files), so it never executed the matchfn.
Test Plan: I updated the tests with a pattern to force this code path to be hit.
Reviewers: #sourcecontrol, ttung
Differential Revision: https://phabricator.fb.com/D2750982
Summary: When the extension is loaded, it's always enabling manifestdiskcache. We want to be able to switch it on via a config variable.
Test Plan:
[andromeda]:~/work/fbsource:0000000> time hg diff --hidden -r 885961 -r 892525 --config manifestdiskcache.enabled=True > /dev/null
real 0m1.608s
user 0m1.145s
sys 0m0.455s
[andromeda]:~/work/fbsource:0000000> time hg diff --hidden -r 885961 -r 892525 --config manifestdiskcache.enabled=False > /dev/null
real 0m1.981s
user 0m1.310s
sys 0m0.662s
[andromeda]:~/work/fbsource:0000000> time hg diff --hidden -r 885961 -r 892525 > /dev/null
real 0m2.106s
user 0m1.423s
sys 0m0.670s
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2745769
Signature: t1:2745769:1449783957:bd59780e1d418464767ab46483e4431ec8020858
Summary:
The goal of this extensions is to create obsolescence markers locally for
commits previously landed.
It uses the phabricator revision number in the commit message to detect the
relationship between a draft commit and its landed counterpart.
Thanks to these markers, less information is displayed and rebases can have
less irrelevant conflicts.
Test Plan: Added a new test
Reviewers: pyd, ericsumner, durham
Differential Revision: https://phabricator.fb.com/D2665923
Summary: the '.linkrev()' made downloading stuff one by one and took ages if it were not already downloaded (remotefilelog). this fixes the stuff
Test Plan: former tests still pass and testing this manually in fbsource during rebases, the one-by-one downloading stopped as far as I could see
Reviewers: #sourcecontrol, rmcelroy, ttung
Differential Revision: https://phabricator.fb.com/D2730826
Tasks: 8660367
Summary: In order not to spend too much time manually calculating moves, falls back without any user message if too many are not present in the server or local database
Test Plan: tested manually after removing the database, it still prints a message in the blackbox
Reviewers: #sourcecontrol, rmcelroy, ttung
Differential Revision: https://phabricator.fb.com/D2729800
Tasks: 8660367
Summary: Copytracing works fine unless the ancestor is on the p2() branch, in that case fall back to old copytracing without bothering the user with an error
Test Plan: Former tests still pass and merge cases say the same with or without copytrace the extension
Reviewers: #sourcecontrol, rmcelroy, ttung
Differential Revision: https://phabricator.fb.com/D2729604
Tasks: 8660367
Summary: Only looking up at the renames files, instead of all the files in the manifest
Test Plan: former tests still pass and this speeds copytrace on a high range of commits
Reviewers: #sourcecontrol, rmcelroy, ttung
Differential Revision: https://phabricator.fb.com/D2728529
Tasks: 8660367
Summary: template names were not showing up in the documentation
Test Plan:
12/08 11:20 cdelahousse@dev4253 /data/users/cdelahousse/fb-hgext
$ hg help template --config extensions.phabdiff=phabdiff.py --config extensions.phabstatus=phabstatus.py
phabdiff String. Return the phabricator diff id for a given hg rev
phabstatus String. Return the diff approval status for a given hg rev
Reviewers: #sourcecontrol, ttung
Differential Revision: https://phabricator.fb.com/D2735148
Tasks: 9287658
Summary:
Commit 2f72e7519155 in core hg added an extra 'am' action to the merge state.
This broke sparse. This change simply adds it to the list of actions to apply.
Test Plan:
Ran the sparse tests
$ ./run-tests.py -j 40 test-sparse* --with-hg=~/local/hg-repo/hg
....
# Ran 4 tests, 0 skipped, 0 warned, 0 failed.
Where the mercurial's tip is 27ad998ef93f
Reviewers: #sourcecontrol, durham, sid0, ttung
Differential Revision: https://phabricator.fb.com/D2732213
Summary:
In case of crash, instead of printing an ugly stack trace, we want to
paste the message to some pastebin-like places. This extension allows
us to do so.
Test Plan:
1. Add `raise 1` to a random hg command, for example, `hg status`
2. Modify `~/.hgrc`:
```
[errorredirect]
script = (echo HEADER; cat; echo FOOTER) | cat > /tmp/a && echo '/tmp/a written'
```
3. Run `hg status` and confirm the shell script works and no stack trace is printed
Also, run `test-errorredirect.t`
Reviewers: rmcelroy, #sourcecontrol, ttung
Reviewed By: ttung
Differential Revision: https://phabricator.fb.com/D2715697
Tasks: 9259456
Signature: t1:2715697:1449173573:7a5abdb3cf3087128bdf688a596d97bb13f27783
Summary: Queries were too big
Test Plan: Former tests still pass, copytracing doesn't raise an exception on 10000 anymore.
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2719221
Tasks: 8660367
Summary: Using it on 10000 commits makes SQL crashs because the queries are too big. Modifies buildstate to check if the oldest and most recent commits on the public branch, rebased to, are in the database, if yes: Assumes all of the nodes in between are. If not: goes through all the nodes by 1000 to check/retrieve them from the server. To avoid double checking if the hash is present in the database, during a retrievepkg, missing hashes are manually added and never asked to the server (this should mostly never happem)
Test Plan: The former tests still pass and buildstate doesn't raise an exception anymore when rebasing over 10000 commits
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2718840
Tasks: 8660367
Summary: Only add a copy in the dictionary is that file was modified in the other branch or in some weird case useful when rebasing several commits at a time. This avoids unnecessary merges.
Test Plan: Old tests still pass
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2718786
Tasks: 8659945
Summary:
This allows us to target the statprof data at a file of the
wrapper's choosing.
Test Plan: HGPROF=stat STATPROF_DEST=/tmp/statprof.data PYTHONPATH=/Users/tonytung/work/mercurial/facebook-hg-rpms/fb-hgext hg.real --profile status
Reviewers: durham, ericsumner, rmcelroy
Reviewed By: rmcelroy
Subscribers: mitrandir
Differential Revision: https://phabricator.fb.com/D2715997
Signature: t1:2715997:1449105707:c07c83c0889c33cc693836917100d3007d0b631b
Summary:
`hg rage` is useful collecting information suitable for error reports.
Currently it is hardcoded to create a new task. This patch adds an
`--preview` option to print the information without creating tasks.
Test Plan:
1. `hg rage --preview` prints expected information
2. Mock `oncalls`, `arc`, `tasks` and confirm `hg rage` works
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.fb.com/D2716395
Tasks: 9259456
Signature: t1:2716395:1449110560:efa372f5aab0cf2c586339413f4a0ebf27ad9014
Summary: adding comments
Test Plan: former tests still pass
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2713383
Summary: the option copytrace.pushmvdb allows to use the push command (with nothing to push) to send the whole database to the server and fill it
Test Plan: I tested it manually with an XDB. I am not sure how to automate that see what's present in the XDB
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2713157
Tasks: 8660367
Summary: adds a 'fillmvdb' command to backfill the move db with --start and --stop options
Test Plan: tests with several --start nodes and one --stop revision
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2713126
Tasks: 8659945
Summary: The interactive rebase which is using new histedit base keyword underneath.
Test Plan: see tests
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: durham, rmcelroy
Differential Revision: https://phabricator.fb.com/D2705834
Signature: t1:2705834:1449024840:c29ee246492c5e7c9e595b65ba256e5326ef631d
Summary:
Resolve the revset configured, and use that to insulate revs from pruning.
Built a unit test.
Test Plan: passed unit tests.
Reviewers: rmcelroy, mpm, pyd, durham
Reviewed By: durham
Subscribers: mitrandir, akushner
Differential Revision: https://phabricator.fb.com/D2573162
Signature: t1:2573162:1449076016:9353a80b8801accfe634990285496fab44a66d6e
Summary:
# Intercept manifest.revision(..). The cache is checked, and if it's not there, resume the normal path. Once the normal path is complete, write to the cache.
# Intercept manifest._addrevision(..). This may be used in bulk operations, such as pull. Since we don't want to flood the cache with a lot of entries we may not care about, we record all the nodes that are added. We add an atexit hook to then record the last N nodes to the cache.
# Writes to the cache are done to a temp file, then atomically renamed into place.
# On reads, we run the checkhash function. This costs us ~100ms per manifest in fbsource, but ensures a corrupt cache doesn't break us. Love to debate this matter.
# On each batch of writes, we spawn a background copy of ourselves to prune the cache. We use the mtime of a marker file to determine the last time the prune happened. We calculate the odds that we should be doing the prune using a couple constants and the time since the last prune. If another prune happened recently, the dominant factor is a small probability that we run the prune, regardless of the interval. If no prune has happened recently, the dominant factor is the seconds-since-prune configuration variable.
Some performance numbers (all averaged across 10 runs)
* diff between two revs: 2.29s without caching; 1.75s with caching
* rebasing 4 diffs: 12.1s without caching; 10.7s with caching
Test Plan: passed the rudimentary correctness unit tests. with fbsource, ran a small handful of commands without anybody tripping and falling.
Reviewers: rmcelroy, ericsumner, mpm, pyd, durham
Reviewed By: durham
Subscribers: akushner, mitrandir, cdelahousse
Differential Revision: https://phabricator.fb.com/D2564490
Signature: t1:2564490:1449075868:70974c62e6bff6521b6f500b5bff3a260ddd6c6d
Summary:
Forbit paths starting with / in sparse file and using the command
line arguments. Also fix a typo (util.abort vs util.Abort)
Test Plan: added test
Reviewers: durham
Differential Revision: https://phabricator.fb.com/D2696541
Summary: running the tests through dummy ssh to test bundle2
Test Plan: the old tests pass, the modified one now uses remote
Reviewers: #sourcecontrol, rmcelroy
Differential Revision: https://phabricator.fb.com/D2705240
Tasks: 8660367
Summary:
Something changed in upstream hg to make mergestate.active blow up without when
not no instantiated with `.read(repo)`
Test Plan:
Ran tests using appropriate hg (release)
11/30 17:35 cdelahousse@dev4253 ~/local/fb-hgext/tests
$ ./run-tests.py test-morestatus.t --with-hg=~/facebook-hg-rpms/hg-crew/hg
.
# Ran 1 tests, 0 skipped, 0 warned, 0 failed.
Reviewers: #sourcecontrol, rmcelroy, ericsumner
Differential Revision: https://phabricator.fb.com/D2706230
Tasks: 9259195
Summary: People complain that `hg status` won't tell them if the repo is in a interrupted update state. This diff adds it.
Test Plan:
1. `cd` to some big project
2. Pick a random old revision from `hg log`, say `fdaa3224d9bd`.
3. `hg update fdaa3224d9bd`
4. Shortly after, in another terminal, `pkill -9 hg`
5. Check `hg status` will print:
```
# The repository is in an unfinished *update* state.
# To continue: hg update fdaa3224d9bd
# To abort: hg update .
```
Also run `run-tests.py test-morestatus.t`.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: durham, pyd, cdelahousse, lcharignon
Differential Revision: https://phabricator.fb.com/D2691730
Tasks: 9200036
Signature: t1:2691730:1448496639:135542e2698e44a824debd74d6393b98cc74e014