Summary:
Infinitepush has too many options and many of them are unused or has never
been changed from the default value. Let's remove some of them.
Test Plan: Run infinitepush tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D141
Summary:
D17 was reverted because it broke creating bundle for non-general delta repos.
The reason is the following: D17 made infinitepush extension override
changegroup.supportedoutgoingversion() function and discard '01' version.
For non-general delta repositories it resulted in broken `hg bundle ...`
command.
`abort: repository does not support bundle version 01`
This diff fixes it by not overriding supportedoutgoingversion(). Instead
getscratchbranchpart() has its own logic of selecting changegroup version.
Test Plan:
Run unit-test
Run `hg bundle -r . --base .^ somefile` in non-general delta repo,
make sure it works fine.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D81
Basic file corruption handling: if file is corrupted, we nuke our history.
Downside is that we won't be able to undo furter back in case of a corruption,
but considering corruption this is expected.
Differential Revision: https://phab.mercurial-scm.org/D111
Makes obs markers for undos more meaningful. When an undo performs a strict one
to one change, the written obs marker reflects that and the user even gets a
helpful ui message in smartlog. One to many undos do not support such obs
markers (currently) because we can't tell splits and divergence apart easily.
Differential Revision: https://phab.mercurial-scm.org/D108
Allow user to keep working copy changes after undo, mimicking unamend and
uncommit behavior. As discussed at the team lunch, this allows undo to remain
ignorant of what command the user has run while conforming to user expectations.
In the future this could be done in a smarter way where we properly restore hg
status dynamically.
Differential Revision: https://phab.mercurial-scm.org/D55
Prevents users from accidentally crossing gaps in their history and adds an
overwride. In most cases undoing across a gap isn't desired as the connection
between the pre and post states is unkown. While undoing across a gap is not
destructive or inherently risky, it is inherently confusing to the user since
we don't know how many and what commands where run. Furthermore, there is no
guarantee that the pre and post states of a gap are actually connected in any
sane way.
Differential Revision: https://phab.mercurial-scm.org/D53
Implements, and makes default relative undos and adds redos. A relative undo
behaves differently only if you haven't performend any repo changing operations
since your previous undo or redo, in which case you operate relative to that
undo/redo. This means that a second undo will not undo the previous undo but
instead bring you furter back.
Differential Revision: https://phab.mercurial-scm.org/D52
Adds undo command that changes working copy parent, bookmarks and
visible draft commits to a previous repo state.
Differential Revision: https://phab.mercurial-scm.org/D51
Summary:
Update the phabstatus code to peek ahead at revisions to be logged by
`hg log` and `hg log --graph` and query phabricator for multiple revisions at
once, rather than having to query them one at a time.
Previously it had special integration with the smartlog where it could do this
for smartlog, but not for the normal "hg log" command.
Wrapping the revset iterator this way feels somewhat hacky, but this seems like
the best way to achieve the desired results without upstream changes. (In an
ideal world we would perhaps update the log code to process things in an
asynchronous fashion, to better support templates that may take a non-trivial
amount time to render. Ideally the revset query would be processed in parallel
with template rendering.)
Test Plan:
Confirmed existing tests still pass, and manually tested various combinations
of `hg log`, `hg log --graph` and `hg smartlog`
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D80
Summary:
I haven't tracked down where this change came from, but it looks fairly
benign and straightforward to fix.
Test Plan: The test now passes
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D147
Summary: D123 failed to update this test as well
Test Plan: Run the test; it now passes
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D146
Summary: Adding a drop extension which drops specified commit from the stack.
Test Plan: Unit tests which are part of this diff and manual testing.
Reviewers: durham, gshanbhag, #mercurial, kulshrax
Reviewed By: kulshrax
Subscribers: mitrandir, quark, #mercurial, phillco, avig, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5346014
Tasks: 19602078
Signature: t1:5346014:1500438430:b38acce97940fdeb7103ae70844cce71fdd79698
Summary: This patch adds a `--clean` flag to `hg prev` and `next` that discards any pending changes, similar to `hg update --clean`.
Test Plan: See included test changes.
Reviewers: #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D140
Previously there is a race condition:
origpinned = loadpinnednodes(repo)
newpinned = ....
with repo.lock(): # the lock might be taken by process X
# get the lock after some time. at this time, the state file might
# be updated by process X but we are not aware of it.
savepinnednodes(...) # process X's change gets discarded
This patch solves that by making the write function takes a delta instead of
full content, and apply that delta inside a lock. Using repo lock is
expensive so we use a single-file lightweight flock instead.
Differential Revision: https://phab.mercurial-scm.org/D139
When pushing the current changeset like `hg push -r . --to x`, try to update
the working copy parent.
Differential Revision: https://phab.mercurial-scm.org/D123
Summary:
The history pack writer had a bug where if the same node was added to the
mutablehistorypack N times, it would write out that it had N entries, but then
it would only write a single entry. This caused corruption (the length value
didn't match the actual number of entries) that broke repack.
This primarily affected users who used the old version of treemanifest (where
trees were converted on the client side). The new version of treemanifest only
seems to repro this in rare cases, like when rebasing multiple commits that
create the same trees.
Test Plan: Added a test. It failed before and passes after.
Reviewers: #fbhgext, mitrandir
Reviewed By: #fbhgext, mitrandir
Subscribers: akushner
Differential Revision: https://phab.mercurial-scm.org/D128
The upstream has added some warning around repo.svfs/vfs write operations
without taking locks. For undo, we don't want to take the repo lock (since
that means read-only operations like `hg log` will be blocked by another
`hg commit`). So undo has its own locking and own transaction (for lower
overhead). Therefore move all files we may write (including lock and
transaction files) to `.hg/undolog` and whitelist the directory at
`localrepository._wlockfreeprefix` to bypass the checks.
Differential Revision: https://phab.mercurial-scm.org/D112
Summary:
Upstream change 6ddb2645abf5dced7e8e4612c8cf9d11cbf468f6 made
the debugobsolete command print out the number of changes it obsoleted.
Test Plan: run the tests
Reviewers: #fbhgext, mitrandir
Reviewed By: #fbhgext, mitrandir
Differential Revision: https://phab.mercurial-scm.org/D133
Summary:
Remotenames no longer emits this devel-warn (once some in-flight
patches are accepted, at least).
Test Plan: run the test
Reviewers: #fbhgext, mitrandir
Reviewed By: #fbhgext, mitrandir
Differential Revision: https://phab.mercurial-scm.org/D132
Summary: This prevents some recently-introduced devel-warnings from breaking the tests.
Test Plan: fewer devel-warns while running tests
Reviewers: #fbhgext, mitrandir
Reviewed By: #fbhgext, mitrandir
Differential Revision: https://phab.mercurial-scm.org/D131
Implements lighttransaction(repo) which improves performance of hg undo and
prevents infinite loops caused by hooks that run true hg commands. Also adds
_getrevlog and _invertindex commands, factoring out code that will be reused.
Changes output for gaps when typing hg debugundohistory -l for slightly
better ui and clearer testing. Lastly, changes lock from repo lock to new
undolog lock and tests this. In the future, with some changes to undo.log,
we may be able to take the lock later, bypassing the need to take it for
read-only operations.
Differential Revision: https://phab.mercurial-scm.org/D50
Summary:
Upstream hg recently introduced new developer warning if files inside .hg are
modified without taking a lock. The usual fix is to add file in
localrepository._wlockfreeprefix list, but it doesn't work for "needrebuild"
fastpartialmatch file because it's stored inside .hg/store.
So to get rid of developer warning let's move needrebuild file to .hg/.
And since we are detecting that partial index needs to be rebuilt in revlog class,
I also had to wrap `runcommand()` and create needrebuild file there, because
`runcommand()` has vfs object, while revlog class doesn't.
Test Plan: Run tests
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D99
Summary:
This test writes file to the vfs to indicate a hook is done. We need to tell
Mercurial that this file is ok to write outside a lock.
Test Plan: Test now passes
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D101
Summary:
Previously prefetch on pull ran in foreground. Now it can run in background
if specified. Optionally background prefetch can be followed by background
repack.
Test Plan: Added a test case
Reviewers: simonfar, durham
Reviewed By: simonfar
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5406626
Tasks: 19727343
Signature: t1:5406626:1500059334:207b4100cca536cbe33f6c6dfad596d03a6fa14f
Summary: adding hg amend --to option so it can amends to a specific commit
Test Plan: will add a test for this
Reviewers: juehui, durham
Reviewed By: durham
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5396805
Signature: t1:5396805:1499986779:d555d75c636e37adbe484b5b77c1844fcacfdc86
Summary:
Hooks should run with awareness of the tree pack data, so we need to pass the
temporary pack location as part of the hook environment.
Test Plan: Added a test
Reviewers: #fbhgext, simpkins
Reviewed By: #fbhgext, simpkins
Subscribers: simpkins
Differential Revision: https://phab.mercurial-scm.org/D8
Summary:
Adds functionality and a test for when clients pushes a tree pack to the server
without any flat manifest data, and the server writes the correct flat and tree
manifests during pushrebase.
Test Plan: Added tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Subscribers: phillco, quark, dsp
Differential Revision: https://phab.mercurial-scm.org/D5
Summary:
Treemanifest relies on the matcher visitdir function, which was not implemented
in our special sparse matchers. Long term we should migrate to using the core
sparse extension. For now let's just implement visitdir().
Test Plan: Added a test. Previously the test would throw a big exception.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D84
Summary:
When requesting trees from the server, the client sends a list of manifest nodes
it wants and base nodes it has, then the server sends back any parts of the tree
that are in the desired manifests but not in the base nodes. If no base nodes
are sent, then the server tries to pick appropriate base nodes from the list of
manifests being requested.
Previously, when requesting manifest X, it would only try to pick X^ as the base
node (assuming X^ was in the request set). This meant that if you requested X
and X^^, it wouldn't realize they were very similar and instead it would send
the entire X and entire X^^ trees (with lots of duplication).
With this patch, it will always use the previously requested manifest as the
base node for the next manifest, if no base nodes are specified. So requests X
and X^^ will return the minimal set of nodes.
Test Plan: Added a test. It fails before and passes afterwards
Reviewers: #fbhgext, simpkins
Reviewed By: #fbhgext, simpkins
Differential Revision: https://phab.mercurial-scm.org/D75
Summary: This broke hg bundle on non-generaldelta repositories.
Test Plan: Ran the tests
Reviewers: #fbhgext, stash, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D74
We want these behaviors:
- Checking out an obsoleted revision makes it visible even if another
revision was checked out later
- Putting a bookmark on an obsoleted revision makes it visible even if the
bookmark was removed later
- Strip/prune could make them hidden again
This is basically a lightweight version of independent hidden.
Differential Revision: https://phab.mercurial-scm.org/D70
Summary: Check if the client exists, and if not, exit the import. Added a test for non-regression.
Test Plan: running test-p4fastimport-import-badclient.t
Reviewers: davidsp
Reviewed By: davidsp
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5405340
Signature: t1:5405340:1499965824:394077f0d148be2e5fef15902c69703eaf360bbb
Summary:
The check-code test in the upstream mercurial repository was recently updated
to start complaining about "if False" statements. Two locations in fb-hgext
had this issue.
These both look to be copy-and-pastes of the same function, unfortunately.
That should probably be cleaned up too, but I'll leave that for a separate diff
for now.
Test Plan: Confirmed the test-check-code test passes now.
Reviewers: #fbhgext, durham, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D71
Summary:
Make sure that infinitepush work fine with lfs. To achieve it we try to use
changegroup3 if it's available and also run prepush hook before infinitepush.
Test Plan: Run `arc unit`
Reviewers: #fbhgext, quark, dsp
Reviewed By: #fbhgext, dsp
Differential Revision: https://phab.mercurial-scm.org/D17
Summary:
Previously the code required that sizes be of type int. Since python plays loose
with integer types, we also need to support long.
Test Plan:
The existing test-remotefilelog-repack-fast.t test was completely
broken. It only enabled fast datapacks for the server repo, not the clients.
Enabling it for the clients as well catches this issue and verifies the fix.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D54
Sometimes `test-check-*` were skipped. Upon investigation, it's because
`lz4revlog` was imported and `hg` printed warnings with `modcheck`. So let's
make `lz4revlog` whitelisted.
Differential Revision: https://phab.mercurial-scm.org/D49
Summary:
Upstream rolled back the single transaction rebase by default behavior.
We still want it, so let's enabled it for all our tests.
Test Plan: Ran the tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D47
Summary: Upstream made these changes. Let's follow along.
Test Plan: Ran the tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D46
Summary: Will be tehre until remotenames are fixed
Reviewers: quark
Reviewed By: quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D45
Summary: Looks like the upstream has changed it on us.
Reviewers: quark
Reviewed By: quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D40