The old smartlog revset is no longer used.
Test Plan:
Confirmed no user uses `smartlog('all')` or `smartlog('recent')` by searching
`smartlog(` globally.
Differential Revision: https://phab.mercurial-scm.org/D48
Summary:
As part of refactoring the main pushrebase function, let's add some more
comments and move some declarations closer to where they are used (or delete
them entirely if the initial declaration is not used).
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340604
Signature: t1:5340604:1498751551:714faa78b8a3a01e165d7f5335484b89b7205995
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340597
Signature: t1:5340597:1498751423:8b7ddce604ff7c9bfeea897afecaa7e7cfa8beb4
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340592
Signature: t1:5340592:1498751349:cf7172ac9c603db0d18a189dc02394f2f0a547f3
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340586
Signature: t1:5340586:1498751296:f931fb170e0092222a125dc34e2f6ffac74dcfb7
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340576
Signature: t1:5340576:1498751222:7ba075ef49ea9d0ad368e6402fb9e61f0d1d0c94
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340571
Signature: t1:5340571:1498751172:4d926642c68611989ee439fbb0327d6e403cb555
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340565
Signature: t1:5340565:1498751154:81c70d75131977defdaa7f92ef0a3b2214b86381
Summary:
The pushrebase main function is too huge. Let's refactor it into smaller
functions so we can add treemanifest support safely later.
Test Plan: Ran the tests
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5340559
Signature: t1:5340559:1498751124:9c4542e0bbd041fcc584a8eb1122269135fe92c8
Summary:
Now that packs are being sent across the wire during push, pushrebase needs to
handle those packs. It does so by adding them to the store list and replacing
the bundlerepo's data and history store with new ones that include the temporary
packs.
Test Plan: Future patch adds test around receiving trees in pushrebase.
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5329893
Signature: t1:5329893:1499706143:44afeacf594a4f87cdc0d96c3f2700dbd4aadd75
Summary:
We want to enable pushing tree packs during pushrebase, and eventually we can
stop including flat manifest information entirely. The first step is to generate
the tree packs during push. A future patch will handle the incoming parts.
Test Plan: Ran the tests. A future patch adds pack file handling to test this
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5329775
Signature: t1:5329775:1499705168:43ea77c9a5c85c09b40910e102535d89a0504a4d
Summary:
This allows us to quickly switch back to the old behavior somehow by using
Chef overrides.
Test Plan: The file was copied from the old revision. Therefore not tested.
Reviewers: #mercurial, kulshrax
Reviewed By: kulshrax
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5392986
Signature: t1:5392986:1499722593:a895f94b3281ccba709fc219f927e8f6c770054a
Summary:
debuginhibit was removed since we no longer have a separate inhibit state.
smartlog hack about changing "o" to "x" was removed since "obsolete()"
revset is correct and the hack is unnecessary now.
directaccess was removed from tests since inhibit does not depend on it.
`- obsolete()` was added to some revsets to avoid divergence and other
surprises.
Use `inhibit.revive` API in infinitepush and reset to revive changesets
properly.
Remove various hacky code that mangle inhibit state in corner cases.
Most test changes are `o` changed to `x` in output since we draw
`obsolete()` state correctly now. `test-infinitepush-backup-remotefilelog.t`
change was because output could be `bytes/sec` instead of `KB/sec`.
Test Plan: arc unit
Reviewers: #mercurial, kulshrax
Reviewed By: kulshrax
Subscribers: kulshrax, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5391361
Signature: t1:5391361:1499722618:d3c1cf629f0c59ecdf1dfd5e653c1eb6176646b8
Summary:
The main feature we want is to be able to unobsolete an already obsoleted
changeset. The old inhibit code is causing all kinds of unsolvable weird
cases and is hard to deubg or maintain.
This patch rewrites it completely. Basically, we now require people to use
obsmarkers to "unobsolete" changesets. We treat cycles in obsstore as a
normal case and break the cycle using date information.
It should be a neat and correct solution until we want marker exchange.
A "revive" API was provided for other extensions to use.
Tests and other code changes will be fixed in a follow up.
Test Plan:
`test-inhibit.t` was rewritten to test the new features.
Other tests are broken and skipped for now. The next diff will fix them.
Reviewers: #mercurial, kulshrax
Reviewed By: kulshrax
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5391320
Signature: t1:5391320:1499716172:a946381421cc242411f5175ee3b7a3a0bc5a4f07
Summary:
Previously phabstatus.extsetup() would throw an exception if the smartlog
extension was not in use and already loaded.
This fixes the code to use extensions.afterloaded() to ensure that we try to
wrap smartlog functions only after smartlog is loaded. It also handles the
lookup error if smartlog is not in use at all.
Test Plan: Included a new unit test.
Reviewers: #mercurial, phillco
Reviewed By: phillco
Subscribers: medson, mjpieters, net-systems-diffs@fb.com
Differential Revision: https://phabricator.intern.facebook.com/D5375301
Tasks: 16939242
Signature: t1:5375301:1499323251:4bc00c9cba79d60cbbb6738e8f1d648e75055cdb
Summary:
Makes sure repo is filtered by the "visible" filter which hides hidden commits.
Otherwise --hidden flag can mass up "draftheads" storage.
Test Plan: Added a new test case.
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5357222
Tasks: 19822306
Signature: t1:5357222:1499102417:ce78065d36841601fe0dfb1d615d7b3be28c5870
Summary:
Previously morecolors only changes "ui.traceback". This diff makes it replace
uncaught exceptions. It now conflicts with errorredirect (whichever loads last
will be effective) but that's probably fine since morecolors is intended for
the team only.
Test Plan: Added a test case.
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5347030
Signature: t1:5347030:1498751985:b8c750c5bfe4a25f1e0a4dd1cebcfa74fa8739b0
Summary:
Upstream made a coupld of changes (including 4fadfa7f05a2a49a2554f0d70f9a35e085109d44), which changed how bundles are supposed to be applied. This breaks obsshelve's compatibility with old shelves.
This commit just ports the aformentioned upstream change into obsshevlve.
Test Plan: rt
Reviewers: quark, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5347598
Summary: amend performs two transactions, second without command which breaks our assertion, but possibly isn't an issue. This fixes the assertion.
Test Plan: unit tests
Reviewers: #mercurial, stash, quark
Reviewed By: quark
Subscribers: quark, stash, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5326358
Tasks: 19261492
Signature: t1:5326358:1498684945:0fde1df243cdbac67ceb092d30599ebd56a731a5
Summary:
This extension is still enabled by other code that has a longer release
cycle. Add back the placeholder extension temporarily until we confirm their
release removed the config.
Test Plan: Adding an empty file should be harmless.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5321153
Signature: t1:5321153:1498500260:941dd1738a2ab3d3389c4251d86bf7c2ccc17648
Summary: Instead of referencing `hg rebase` --restack option, just reference the `restack` subcommand.
Test Plan:
1. Make a few commits 1, 2, 3, 4 on any branch
2. `hg update 1`
3. Try to amend commit 1
4. Warning message should appear about children left behind
expected: Hint text does not mention `hg rebase --restack`
Reviewers: durham, kulshrax
Reviewed By: kulshrax
Subscribers: medson, mjpieters, kkrewink
Differential Revision: https://phabricator.intern.facebook.com/D5313108
Tasks: 19601780
Signature: t1:5313108:1498249314:98f31f4424341ef51997687293bf99b7297b6cd0
Summary:
It got removed from inhibit by D5258813. It's a useful feature so let's
re-implement it in tweakdefaults.
Test Plan: Added test cases with plain strip and fbamend's safe strip.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5313291
Signature: t1:5313291:1498321590:03e61a5b1acc2df44afcfd6ceb723e17c648ce79
Summary:
`tr` could be None and `tr.release()` there is causing issues.
The next line actually checks `tr` and call `tr.release()` if `tr` is not None.
Test Plan: arc unit
Reviewers: #mercurial, wez
Reviewed By: wez
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5314538
Signature: t1:5314538:1498255892:084e1f5f1521ff7794be43b24510d2b54bf2148e
Summary:
We have seem some errors when closing the database during `db.close()`. This
diff nukes the database if that happens.
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5305123
Signature: t1:5305123:1498166056:8355e861c18c670e6342e541f2bc55d65bc7b1c8
Summary:
This revset will be used by jellyfish to set the proper base in sandcastle. Anyway: a public ancestor is
a valuable commit information so there should be a template for it.
Test Plan: see test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: durham, quark, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5275811
Tasks: 19186426
Signature: t1:5275811:1497979632:9589491be723daf0b127703a7bc4571f7539bd84
Summary:
Previously remotefilelog would open a connection and leave the getfiles command
running on that connection, so it didn't have to reopen the ssh connection each
time. We want to reuse this ssh connection for treemanifest and fastannotate, so
let's switch it to a pool model where the connection is kept open but the
getfiles command is not left open.
If an exception happens while the connection is out of the pool, it is discarded
instead of being added back to the pool.
Test Plan:
Ran the tests. The fastannotate tests changed to reflect the new way
the connectionpool allows use.
Reviewers: quark, #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5280323
Signature: t1:5280323:1497975420:e3ae1ee854a1afc90816502543a19ff36f59b497
Summary:
Improve the error message from the blocknonpushrebase hook to inform the user
that they need the pushrebase extension enabled.
Previously the message indicated that you mush push using
`hg push --to <bookmark>`, but this is not sufficient. Enabling the pushrebase
hook is the most important step here. (The `--to` flag is not part of vanilla
mercurial, and is added by pushrebase, but other extensions like remotenames
also add a `--to` flag.)
Test Plan:
Added a unit tests for `hg push --to <bookmark>` with remotenames enabled but
pushrebase disabled.
Reviewers: #mercurial, davidsp, zhihuih
Reviewed By: zhihuih
Subscribers: quark, medson, mjpieters, net-systems-diffs@fb.com
Differential Revision: https://phabricator.intern.facebook.com/D5276550
Signature: t1:5276550:1497899421:3656bcc3e7358f97fc852e14307b34d8aa4d9951
Summary:
Perforce has a feature called [[ http://answers.perforce.com/articles/KB/3482 | keyword expansion ]].
When a file is marked +k or +ko and you have a string like $Id$, it get's expanded to $Id: SOMETHING$ on Perforce. When importing a file like this from Perforce into Mercurial we need to do the reverse, renaming $Id: SOMETHING$ to $Id$ (and equivalent for all other expansion types).
Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/tests/
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-import.t
$ python ../../hg-crew/tests/run-tests.py test-p4*
Reviewers: #idi, davidsp
Reviewed By: davidsp
Subscribers: davidsp
Differential Revision: https://phabricator.intern.facebook.com/D5266323
Tasks: 19211063
Signature: t1:5266323:1497890444:a1cced5faa5e48c708c2721510952ca4d27d1bd4
Summary: The recent refactoring brought back the original condition from metaedit that was preventing multi-commit metaedits.
Test Plan: see test
Reviewers: #mercurial, quark, stash
Reviewed By: stash
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5274562
Signature: t1:5274562:1497884504:f46988cd1926f52227a907e4e081e65de24080ad
Summary:
Enhance check-ext script to be more strict:
- Only one foreign extension is allowed: `remotenames`
- Require explicit path for in-repo extensions to avoid wrong extensions
being tested
This would make the test more predicatable since system extensions
will be less likely to be imported. Explicit path is better than
setting `PYTHONPATH` since `hgext/name.py` could override
`hgext3rd/name.py` regardless of `PYTHONPATH`.
Test Plan: arc unit
Reviewers: phillco, durham, ikostia, #mercurial, stash
Reviewed By: stash
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5271430
Signature: t1:5271430:1497861776:7dd35ec7c522cd9b26aa0871cb4306b4f1b8993a
Summary: allowunstable is no longer used. So remove it.
Test Plan: arc unit
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5258845
Signature: t1:5258845:1497602890:4b9c7cffc2132df0a7059fe2fdbeddf3e21c1875
Summary:
Now that fbamend has most of the features we want. Replace evolve
used by tests.
Minor changes are made to some extensions to make test pass:
- reset: drop commit reviving support (was provided by "hg touch")
- smartlog: do not assume who provides "allsuccessors" revset
- fbamend: return 1 on "nothing changed"
- fbamend: write operation data for split and fold
- fbamend: do not print incompatibility notice
- fbamend: do not disable itself when rebase is not enabled
- inhibit: remove `bookmark -D` option - use `prune -B` instead
Test Plan: arc unit
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5258813
Signature: t1:5258813:1497604051:0c7334f9a6554cf31aaaaa2a4995b17d4e445847
Summary:
We are going to remove evolve and inhibit. So the warning is no longer
useful.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: ikostia, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254984
Signature: t1:5254984:1497518474:80649544fef3aee90bf9a407d45ddeb9f6d85dba
Summary:
Backport the prune command and its strip wrapper from mutable-history changeset
cb0d62ed5e2a using GPL2 license.
There are some adjustments to make the ported code work well with existing
code better, namely:
- Add a `safestrip` option to control whether `strip` is replaced to `prune`
or not.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254961
Signature: t1:5254961:1497518704:91b200bf791297ff797cc0ff28ab31d7eb294963
Summary:
Merge fbmetaedit which uses a fast path to change commit messages.
Make fbmetaedit a no-op.
Test Plan: arc unit
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254867
Signature: t1:5254867:1497524975:c7cc3ad9d1162332fbdd665eb5a2f6d7ce87a585
Summary:
Backport the metaedit command and its test from mutable-history changeset
cb0d62ed5e2a using GPL2 license.
There are some adjustments to make the ported code work well with existing
code better, namely:
- Removed allowunstable check to simplify the code.
- Make "nothing changed" return 1.
- Minor i18n and check code fixes.
Note: this backport does not include fbmetaedit changes.
Test Plan: arc unit
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254807
Signature: t1:5254807:1497524996:abf856dc9bb8225316ca6c17f41ffa2c9d8d9964
Summary: This is temporary as fbmetaedit will be merged into fbamend.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254803
Signature: t1:5254803:1497520047:2c6eb22ce8cb80e4c785fd0b82311706487f6c7e
Summary:
Backport the fold command and its dependencies (`rewrite`) from mutable-history
changeset cb0d62ed5e2a using GPL2 license.
There are some adjustments to make the ported code work well with existing
code better, namely:
- The `--norebase` flag was renamed as `--no-rebase` and moved to the
backported command so we no longer wrap the split command.
- Rebase now runs inside a same transaction.
- `bookmarksupdater` now accepts multiple revs so bookmarks on all changesets
being folded will be updated correctly. It is a bugfix to the ported code.
Test Plan:
`arc unit`.
Some tests are changed. It seems the new behavior looks better.
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: ikostia, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254681
Signature: t1:5254681:1497520003:f7ec3622286804fead059ab9a8021bb8f3067e64
Summary:
Backport the split command and its dependencies (namely, `bookmarksupdater`)
from mutable-history changeset cb0d62ed5e2a using GPL2 license.
There are some adjustments to make the ported code work well with existing
code, namely:
- The `--norebase` flag was renamed as `--no-rebase` and moved to the
backported command so we no longer wrap the split command.
- Rebase now runs inside a same transaction.
The glob change in tests is because `(tip)` shows up.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: ikostia, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254544
Signature: t1:5254544:1497519470:fe8a7308b35b578fd4f1257cebba15062e752c2f
Summary:
This hack is needed to make split + rebase work well inside a same transaction.
inhibit does special things at the end of a transaction which may override deinhibit.
Sometimes we want deinhibit to override the transaction close handler.
The hack will be removed once inhibit gets removed.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: ikostia, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254517
Signature: t1:5254517:1497519294:89b6de077514252c42fb128760cf9f9241180242
Summary:
split and fold will be backported and removed from evolve. So do not assume
evolve provides them.
Test Plan: Not breaking existing tests
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254455
Signature: t1:5254455:1497519005:aca0373cc61ca5438cee1c9d85f2df77f33d8455
Summary:
inhibit hacks transactioncallback so _deinhibitmarkers might be ineffective
inside a transaction. This diff adds a flag to allow _deinhibitmarkers
effective inside a transaction. It will be used by the split backport.
Test Plan: No new test being added since inhibit is a hack and is going to be removed.
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254416
Signature: t1:5254416:1497519161:b01f3fa59004ded5beaf5dcfc7d18eb2b5227130
Summary:
We are depending on `allprecursors` and `allsuccessors` revsets in multiple
places. Re-implement them in fbamend.
Also reimplement `successors` and `precursors` since they are used by some
other code.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5254403
Signature: t1:5254403:1497519041:8c6f001a6acf8056b5f795575b42922a476ac34b
Summary:
We got TCP RESETs frequently. It's hard to pinpoint the root cause so let's
just add retry for now.
Test Plan: eyes
Reviewers: #mercurial, #ovrsource_warroom, steaphan
Reviewed By: steaphan
Subscribers: steaphan, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5265928
Tasks: 19419154
Signature: t1:5265928:1497635499:17cf5d5cb69b406330326d693a9eceb1d22861f8
Summary:
People want update to optionally not activate a bookmark.
This diff adds an `--inactive` flag to do that.
Test Plan: Added test-update-i.t
Reviewers: durham, #mercurial, quark
Reviewed By: quark
Subscribers: mitrandir, mjpieters, medson, durham, akushner, quark
Differential Revision: https://phabricator.intern.facebook.com/D5228552
Tasks: 8097957
Signature: t1:5228552:1497396566:16322e1a2dfdab30a213ddc37cbde4fc71bffcc0
Before this patch, the pretxnchangegroup 'node' argument would be the last
added node whereas mercurial documention specifies that it should be the first
new changeset. The 'node_last' argument has also been added to both
pretxnchangegroup and changegroup hooks as per mercurial documentation.
Summary:
Move movement commands (next, previous) to `movement.py`. Some common utilities
were moved to `common.py`. I did some minor cleanups on the help output.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5222981
Signature: t1:5222981:1497265815:5dbba53fe7a16dbf924898331496a5c50b54b9f2
Summary:
Going to split fbamend into individual files by commands. `unamend` seems
self-contained to be moved out.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5221159
Signature: t1:5221159:1497261013:d371bcf4406277228fc4f3f6c6aaa4600dab4823
Summary: `fbamend.py` is already long. It will become more complex so let's move it.
Test Plan: arc unit
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Differential Revision: https://phabricator.intern.facebook.com/D5209475
Signature: t1:5209475:1497260957:e84aec4a2f90c8dd1d247b2b0caef48cfbb59c55
This helps doing some validation before accepting a pushrebase.
For example, if you want to prevent users to accidentally pushrebase
changesets to the wrong branch by checking if all pushed changesets are
on the same branch as the destination (--to)
Summary:
There was a change in core mercurial b319e3173a9534a2b7750b69ef446a803c3145ff
that catches all exception from uisetup and extsetup. Let's throw subclass of
BaseException in this case.
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5236650
Signature: t1:5236650:1497363414:9bbde3cabb696bb77a7ffddcb576923e5743c993
There was a bug that was introduced upstream in 469914605447 and fixed in
758d59a5f3515b18c767af69f4ed28060f8af56c. This diff reflects the changes.
Also filestat was changed in 4091c920ac07e27ee8536715297127e56d536dab.
Summary:
Upstream mercurial --stat option shows only aggregated statistics for all
files. This diff make it possible to get diff statistics per file.
It can be used by automation.
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5203835
Tasks: 18508761
Signature: t1:5203835:1496981602:c8a649158892d05442d8d0aa717589974b92ff6b
Summary:
One one more improvement to logging to better measure the impact. Do not log if
file contents are the same as it is explained in the comment.
Depends on D5217007
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5218112
Tasks: 18508761
Signature: t1:5218112:1497317521:e73e8ebe01a4a8ca73ad9fc87b5608d4c9f5484c
Summary:
Previously if file was added in source then it would be considered missing in
destination. This behaviour won't add incorrect copies, but it would do
additional work of checking move candidates for the added file. This diff fixes
it.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5190369
Tasks: 18508761
Summary:
revlog uses transaction.find and transaction.replace in cases where a
datafile is separated from an index (>= revlog._maxinline). In these cases the
importer broke as we did not implement find and replace in filetransaction.
We implement the two methods. However we ned a save way to store the data
portion which find must correclty return. We cannot store json as some
serializations aren't bidirecitonal. We can't store pickle as \n is a common
separator in pickle, and we use that to separate our entries. So we use pickle
and then base64 encode it. This is cumbersome but works.
The fix is aimed to make things "work" and I want to explore options to better
implement find and replace.
Test Plan:
- Working on a test that correclty triggers inline -> separation.
- Deployed it to our test system with test data and see commits comming in.
Reviewers: #idi, #ovrsource_warroom, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5189308
Summary:
Since it is now an independent extension, we don't need to have a knob
to enable/disable obs-based shelve, we can just enable/disable the entire
extension itself.
Test Plan: - run a test
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5181001
Summary: Just for an early detection of bad config being distributed.
Test Plan: - add a test case
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180986
Summary:
Grand goal is to remove all of the shelve-related hotfixes and just have
a separate extension, obsshelve, which we could roll out to all FB users
without worrying about upstream.
This commit just copies current version of core's shelve.py with FB hotfixes
applied on top of it. The only changes are changes in testedwith and a
description at the top of the file and an import of rebase from hgext rather
than '.'.
Test Plan: - it is not enabled and tests are added in a later commit in this stack
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180947
Summary:
Previously we logged every time there is a changed/deleted file conflict.
This generates lots of useless log entries. Most of these entries are valid
conflicts where one file was deleted and another was added. Besides analyzing
these log entries is manual and very time consuming. Let's instead log cases
where copytracing actually helped.
Test Plan:
arc unit
Run with hg-crew test suite with --extra-config-opt
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5175656
Tasks: 18508761
Signature: t1:5175656:1496651487:fe710731213b21aefd1b957d259dc93470c9545c
Summary:
Simple copy tracking for draft commits. It doesn't use db to save move info
because getting move info is quite fast already.
Depends on D5137372
Test Plan: Run tests
Reviewers: #mercurial, durham, quark, rmcelroy
Reviewed By: quark
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5137886
Tasks: 18508761
Signature: t1:5137886:1496348869:8f4a9761fdeb26ddee5e18a318cc85582ef4adbb
Summary: This will be safer if upstream API ever changed again.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5147881
Signature: t1:5147881:1496326141:c70559ffe2bb43953a1a0584163ca24c3235c5f3
Summary:
Copytracing that is based on a simple idea: most moves are either directory
moves or moves of the file inside the same directory. That means that either
basename of the moved file or the dirname of the moved file is the same.
More details in the comments.
Test Plan: Run unit-tests
Reviewers: #mercurial, durham, quark, rmcelroy
Reviewed By: quark, rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5137372
Tasks: 18508761
Signature: t1:5137372:1496243148:8d229c1593da196b674318ee8b37af15a60831c8
Summary:
Fix the tweakdefaults code to extract the --tool argument when extracting
--rebase, and to pass it in to the rebasemodule.rebase() function correctly.
Test Plan: Included a new test.
Reviewers: #mercurial, rmcelroy, quark
Reviewed By: quark
Subscribers: quark, net-systems-diffs@fb.com, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5134466
Tasks: 18770938
Signature: t1:5134466:1495848690:308a8d3fbad39e6ecfeaee04b1b3267c1fa1118c
Summary: It was added by mistake, let's remove it.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D5155301
Tasks: 18508761
Signature: t1:5155301:1496246623:a650cbffa7edf4311f96071e57c61697dae8014e
Summary:
1) Log commit hashes. Since we have infinitepush we may see the actual commits that caused the problems.
2) Log reponame
3) Wrap logging code in try/catch so that any errors in this code won't affect clients
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5146976
Tasks: 18508761
Signature: t1:5146976:1496241350:1d8a921527a0e2d984f6a46452697428df1757be
Summary:
`gdbm` is unavailable on Windows. Python provides module called `anydbm` which
abstracts the implementation of `dbm` and is even capable of using a dump
Python-only implementation if nothing is installed.
Test Plan: - rt
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5154620
Summary: Fix lint errors and make the test pass.
Test Plan: arc unit
Reviewers: #sourcecontrol, sid0
Reviewed By: sid0
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5142477
Signature: t1:5142477:1496173824:bf941d895d3259fc788c09d4fefca7dddd11a33b
Summary:
Vendored using GPL2 license from https://bitbucket.org/marmoute/mutable-history
changeset c9f1118b33d60f8faa4b89988a8155c544f5bb0d without modification.
Test Plan: N/A. The code was imported as is.
Reviewers: #sourcecontrol, sid0
Reviewed By: sid0
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5142063
Signature: t1:5142063:1496173803:d0a9fa50a8423a531432ac3cff378b50952684b1
Summary:
This adds the `skiprevs` parameter to all `filectx.annotate` methods
to match the upstream change.
For fastannotate, things is a bit more complex since it's a mix of two
algorithms. For now we just fallback to the slow path for correctness.
I'll think about adding back a fast path later.
Test Plan: arc unit
Reviewers: sid0, #mercurial, quark
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5128392
Summary:
copytracing extension is going to be simpler than I expected in the beginning.
There is no need to separate folder, let's move it to hgext3rd
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5146585
Tasks: 18508761
Signature: t1:5146585:1496147733:ad6ad14f663a8b9bf4b687f0767395321f9840b7
Summary:
`revlog.ancestor` is expensive on long changelog, but is only called a few
(about 30) times for smartlog usage. Therefore we could simply cache the
result in a key-value database.
This speeds up smartlog by about 200ms.
Test Plan: Added a new test
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5135746
Signature: t1:5135746:1495783503:411260551fd29fda42c9fc809b56f8f77fb2eaf4
Summary:
Previously, the tracer extracts file name, function name from Python code
objects and stores them as std::string. And frame the de-duplication logic
hashes those strings, which is actually quite expensive.
`hg id` takes 1.0 seconds without frame de-duplication, and 2.5 seconds with
de-duplication.
This diff assumes Python code object is unique (i.e. Python won't generate two
code objects for a single code segment). That seems reasonable and `lsprof`
seems to make a same assumption.
With that assumption, just store `PyCodeObject` (contains file, method name and
line number) instead of `std::string` (for file, method names) and line numbers
for code identity and use the raw address of `PyCodeObject` to do frame
de-duplication.
That is helpful during profiling and de-duplication:
- During profiling, no need to copy strings (convert to std::string),
therefore less overhead
- During frame de-duplication, no need to read long strings and hash them,
therefore much faster
Debug flag during compilation is added to make debugging easier as the code
starts to mix of C++ and Python objects, which means mistakes could be made
more easily.
Test Plan:
With this patch, `hg id` with frame de-duplication takes 1.0 seconds.
There is no visible overhead doing de-duplication. Cheers!
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5112636
Signature: t1:5112636:1495562232:dd0724198ebb7f2eb4e9fd3a83517fc9160fa01e
Summary: This is what extensions should belong to.
Test Plan: Changed existing test.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5113042
Signature: t1:5113042:1495561987:d1af0f7cebfdb8b0c1a6bb71cdc826d817a4e441
Summary:
Upstream has added an optional operation argument to createmarkers, which we
need to also accept. This argument is currently only processed if a config
option is set, so for now we will still put the operation in the metadata dict
manually.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5106511
Signature: t1:5106511:1495485044:23d45d9ba389cf0d49b31705ae36902310c5056c
Summary: Upstream has deprecated begin/endparentchange in favor of a context object.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5106500
Signature: t1:5106500:1495485058:8377335a0f678de7bb50cb93fff29bcfeb53fe1d
Summary: Upstream has deprecated cmdutil.commands() in favor of registrar.commands()
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5106486
Signature: t1:5106486:1495485074:0e20f00622cc651e8c9dda837f84dd84cc51099e
Summary:
Previously, the progress bar is file-level - it moves when a file is transferred.
When uploading or downloading a single giant file, progress bar matters. And
this diff adds it to make people more patient.
Test Plan:
Manually upload and download several big files.
Make sure the progress bar appears in both cases.
Also make sure the output is sane with `-v`.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5100014
Signature: t1:5100014:1495316719:c500ccd63d3a495e41575cadd72419a41f5fb259
Summary:
This allows automation to know which modified or added files are LFS for
specific changesets.
Test Plan: Added a test
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5091591
Signature: t1:5091591:1495163606:138638d8ccc57b8ed6c1e324750ec5dc15c198a0
Summary:
When remotestore is a null store, uploading is a no-op and can be skipped.
This diff makes it so.
Test Plan: arc unit
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5090686
Signature: t1:5090686:1495144964:956549307912f4a44201aa305959bf8de26ac028
Summary:
conduit HTTP POST request did not have correct content-type header set.
Now they do. Ideally we should use python-request package to do HTTP
but I do not know enough how to import these dependencies so I just went
with the minimal changes.
Test Plan:
ran hg log from dev environment and eventually got it all working.
{P57411895}
Reviewers: simpkins
Reviewed By: simpkins
Subscribers: net-systems-diffs@fb.com, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5080725
Tasks: 18294945
Signature: t1:5080725:1495052201:1bbd6edad4c1c4b3482a7479259460a815947630
Summary:
`repair.strip` removes required revisions and their children unconditionally.
That means innocent children may be removed. This patch fixes it.
We may want to have an in-core function for this feature to not strip innocent
children.
Thanks Zibi Braniecki from Mozilla for reporting [1]!
[1]: https://bitbucket.org/facebook/hg-experimental/issues/6/hg-absorb-merges-diverged-commits
Test Plan: Added a test
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5073342
Signature: t1:5073342:1494972231:ca2a9881415119047771c8f35e059f4bfb1749e5
Summary:
When a bundle is created, the bundle could be exchanged via copy and possibly
eventually reach to a publishing repo. If we don't upload LFS blobs, hg server
could have revisions that can never be checked out or verified.
So let's just assume bundles generated by `hg bundle` will be public, and
upload LFS blobs automatically, without depending on other code review tooling.
Note: there is a `preoutgoing` hook which will be triggered in this case,
however it's not useful since it does not have the `outgoing` information.
Test Plan: Will add a new test
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5050945
Signature: t1:5050945:1494958648:0c46ab1d85755838ba189bbb1e0673882922bb58
Summary:
`util.py` only contains 2 small things: `lfsvfs` and `sha256`. Both of them
only have one user (in terms of files). Therefore just move the code to
related files to make it simpler.
Test Plan: arc unit
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067862
Signature: t1:5067862:1494955824:b99021f1bb44568dc0c738b0e472eb732f2bc91a
Summary:
The error was renamed to `InvalidPointer`. This diff updates error handling
to catch that instead.
Test Plan: arc unit
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067496
Signature: t1:5067496:1494955510:5f0162a8cc6f1d0d83e3ab6319ec3202028684d8
Summary:
This simplifies code a bit, and could be useful for 3rd party code. We already
have `isbinary`, `islink`, `isexec`, `isabsent`. So another `is` method looks
fine.
Test Plan: Run existing tests
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067369
Signature: t1:5067369:1494955466:ae17e310e743c704cc0d9bb73e0d2e82adcffff8
Summary:
The `filectx.cmp` fast path allows us to show "binary file changed" diff output
when two binaries have the same size but different content.
Test Plan: Added a test case
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5067266
Signature: t1:5067266:1494954783:a41e8213782afe24618ef2930c9576f21610fd3e
Summary:
Calculating what blobs to upload should be fast since we use changelog `files`
information. Users will see `lfs: uploading ...` very soon. So let's downgrade
`lfs: computing set of blobs to upload` to a debug message to make `-v`
cleaner.
Test Plan: Updated existing test.
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5066600
Signature: t1:5066600:1494954115:c00925a1930f9b53e914078d32b6c4e4161099ee
Summary:
Downloading or uploading a single LFS object could take long. Instead of
showing a summary of what objects are downloaded or uploaded, print a message
per object if --verbose is provided.
Test Plan: Added a test
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5066327
Signature: t1:5066327:1494953894:3593436ff53eaff117a2932476dfc4b867fb9f17
Summary:
Previously, when an object is not found server-side, we error out during the
basic transfer API. This diffs move the check to the batch metadata API so the
check is preformed earlier.
That also means, when batch fetching many LFS objects, we could report multiple
objects being missing instead of just one.
Test Plan: Modified an existing test
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5065623
Signature: t1:5065623:1494952131:cb1df73e1cea21e07bfd0ec630bacec60e5b385c
Summary:
We are adding a simple transaction that works only with filelogs but
allows for concurrent access from multiple workers. This allows for a proper
rollback in case of a failure in a worker process, which previously would result
in bad data in the repositoriy.
Test Plan: rt test-p4* test-check*
Reviewers: #mercurial, durham, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5070340
Signature: t1:5070340:1494958313:b10b1eac5b42b36d1a587c4ae1c95fc2f8b5ad35
Summary:
The batch API allows server to return errors per object, handling them early
seems to be a good idea.
This is an attempt to distinguish "cannot upload - no permission" from
"no need to upload - already exist".
Unfortunately, `lfs-test-server` reference implementation does not provide
the error message so it's not reflected in tests.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057816
Signature: t1:5057816:1494951879:07f2b67408e9d77255104b932baae2e50af9890b
Summary:
The LFS uploading or downloading process consists of 2 parts: a batch API to
get metadata about objects, followed by `len(objects)` requests.
This diff moves the first metadata API out from a giant `_batch` method to
make the code structure easier to maintain. Later diffs will further split
`_batch` method.
A side effect is `lfs: mapping blobs to #{action} URLs` message is removed.
More user-friendly message will be added back in a later patch.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057541
Signature: t1:5057541:1494949989:d510c3d9369744e7ee776c0d0a26d263dfaf8352
Summary:
Displaying total bytes to upload is currently inaccurate - the server could
already have some objects so only a subset of selected objects will be
uploaded.
Besides, we pass `pointers` to related upload and download APIs so `total`
could be calculated from them.
This diff removes the inaccurate "need to upload" message and unnecessary
parameters. An accurate message will be added in a later patch.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057470
Signature: t1:5057470:1494949554:07e637a8b58c894598b3f0c2dd53f80a5ade25a8
Summary: Added -U/--unified NUM to fbshow.py, and used that to set diff.unified=NUM.
Test Plan: hg show --help; hg show -U 1; hg show -U 2; hg show -U by induction.
Reviewers: mburman, simonfar, ikostia
Differential Revision: https://phabricator.intern.facebook.com/D5052156
Tasks: 10006036
Tags: python
Summary:
A try block is only effective for the HTTP error. Let's narrow it down to
just the HTTP request.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057107
Signature: t1:5057107:1494634308:584877babc6a4705fa0740788dcf58affdf51bec
Summary:
There are `1+n` HTTP requests. `n` of them is handled. But the first one
about JSON metadata is not. Let's handle it.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057053
Signature: t1:5057053:1494634184:fa0e562dc7879379106bf37915a2e5ea3cc01a4d
Summary:
The server or the HTTP library may provide more detailed error message.
Let's use them. `RequestFailedError` is also renamed to `LfsRemoteError` to
make it clear it's related to LFS and network.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5057014
Signature: t1:5057014:1494634052:00c1cb1b337a0e4cb92828cd49e95b7b0ff7e540
Summary:
It's caught, and re-raise with RequestFailedError. We can just raise
RequestFailedError directly.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5056886
Signature: t1:5056886:1494633307:3fdf2fab13e783224d343266a1278c41ed4394e8
Summary:
_batch is called by programmers. If action is not expected, it's a
ProgrammingError.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5056822
Signature: t1:5056822:1494634121:59737eb0d3f42d706ee8b0dc18ec7a4b49ada34f
Summary:
move p4fastimport under hgext3rd as that's where it belongs.
Also has the benefit that we package it up.
Test Plan: rt test-p4*
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5056664
Signature: t1:5056664:1494631758:4892f47922d8fbbd2c1f7793f3f29ee73fa8fa42
Summary:
For long I have been wondering - we have `oid` already and an `oid` could
identify an object already, why do we need a `StoreID` which contains both
`oid` and `size`? It does not seem necessary?
I figured out the answer - the batch download or upload API *requires* size
information per object [1].
Since we will have LFS pointers during upload or download, we can just use
pointers. This diff removes `StoreID`, changes remote blob store to take
`pointers` directly, and local blob store to take `oid` directly.
As a side effect, `debuglfsupload` no longer takes `-o`, which seems fine
because `-r` should be more useful.
[1] https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
Test Plan: `arc unit`
Reviewers: davidsp, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D5043694
Signature: t1:5043694:1494496522:ea10f3dd12fc2ae3ab77b8f623eeead84dcc25fa
Summary:
Read the Git-LFS specification [1] and implement most checks to prevent
programming error and detect data corruption.
The new code should be stronger than what was before the refactoring, since the
old code only checks keys but not values.
[1]: https://github.com/git-lfs/git-lfs/blob/master/docs/spec.md
Test Plan: Added a new test
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5046740
Signature: t1:5046740:1494543072:2f0dbfc07cd52a10572550a277d850bdf3f78d27
Summary:
Since we decided to only support GitHub's Git LFS specification, there is no
need to support multiple pointer types, so the code could be simplified.
The old code special case keys like `version`, `oid`, `hashalgo`, which makes
it longer than necessary. The new code is a rewrite treating everything as a
normal dict entry so the pointer class is much shorter: 76 -> 21 lines.
Data validation is temporary lost, which will be added back (and stronger) by
the next diff. It is separated to make review easier.
Test Plan: Run existing tests
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D5043547
Signature: t1:5043547:1494543031:ac1100939a10a79dfd749ab6ac9c3bb7fcd84dbf
Facebook probably doesn't want external users reaching out to them directly
for support, so this should be customizable to specify other possible courses
of action (especially in cases where githelp is further extended to document
git-related company-internal commands in other companies).
Summary:
`filelog.filenode` could be `None` when it's unknown - like working copy. That
breaks `isbinary` test. Let's modify `_islfs` check to return False to disable
lfs code path in that case.
Test Plan: Added a new test.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5034058
Signature: t1:5034058:1494431790:a02b69addf5d2f9b6b9a27ad71ed4f136b2bfd2b
Summary:
The config option was designed to be used server-side to avoid accessing remote
LFS blob stores. However, we now have `lfs.url=null:` as a clean alternative,
which will explicitly raise if the server ever tries to download remote
content. So `bypass` is no longer needed.
`bypass` could also be used for displaying raw content. That is doable using
`debugdata`.
Test Plan: Modified existing tests
Reviewers: #mercurial, rmcelroy, davidsp
Reviewed By: davidsp
Subscribers: davidsp, rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009725
Signature: t1:5009725:1494260384:332d7bd658359c004342efd01e4f13b6fc5499b1
Summary:
`lfs.blobstore` is a path used to store local blobs. Some of the blobs are not
uploaded yet so they couldn't be easily discarded. Although blobs downloaded
from the server could be removed if necessary.
It does not make much sense to make this a config option - the data should be
stored reliably. It's also dangerous to allow write to arbitrary paths under
`repo.vfs`.
This diff makes the local blob store fixed path at `.hg/store/lfs/objects`.
The choice is similar to `.git/lfs/objects`, but with `store`, shared repo
could share their lfs stores.
Test Plan: Modified existing test.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009664
Signature: t1:5009664:1493978440:c3f6351d0ea0cca2ce3caa9f7260c5d65bcc0e5f
Summary: This makes it possible to upload lfs blobs without going through push.
Test Plan: The feature will be used in the next change.
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009622
Signature: t1:5009622:1494230385:0df33ed12c96bc91f6252398ce5091057fe32a21
Summary:
This makes it possible to reuse part of them - like uploading blobs for
given revisions without going through prepush hook.
`pointer.tostoreids()` was changed to `pointer.tostoreid()` to simplify
things a bit.
Unnecessary remoterepo assignment was removed.
Test Plan: `arc unit`
Reviewers: #mercurial, davidsp, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009560
Signature: t1:5009560:1494230285:6469a2701baa8cfa4511a08149a37fc429733343
Summary:
The `lfs-test-server` reference implementation [1] validates the hash, and
40-byte sha256 hexdigest will not pass that check.
[1]: https://github.com/git-lfs/lfs-test-server
Test Plan: A test will be added in the next diff.
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009319
Signature: t1:5009319:1494006078:32950c5490935d9786553fc07d01f1fc92aacf25
Summary:
The request JSON data used in the batch API should have `size` field as an
integer, not a string. This was discovered when testing against GitHub's
`lfs-test-server` implementation [1]. The latter was written in Golang and has
strong type requirement, it will treat `{"size": "42"}` as `{"size": 0}`.
[1]: https://github.com/git-lfs/lfs-test-server
Test Plan:
An integration test with `lfs-test-server` will be added once remaining issues
are resolved.
Reviewers: #mercurial, ikostia, davidsp
Reviewed By: ikostia, davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5009248
Signature: t1:5009248:1493977299:5daf8d32cd8c933be71a41afcc7ff832eb7edb5a