D319 renamed `peer.pipe[ioe]` to `peer._pipe[ioe]`.
D320 removed `peer.batch`.
D331 renamed `subprocess` to `_subprocess`.
D336 renamed `_capabilities` to `capabilities`.
Let's be compatible with those changes.
Differential Revision: https://phab.mercurial-scm.org/D425
Makes hg undo -i and hg undo -p output show an "undo to time, before command"
message and adds directions (left, right, return, q). Also adds pager check as
pager break interactiveui.
Testing: run hg undo -p and hg undo -i and see output
Differential Revision: https://phab.mercurial-scm.org/D448
Obsoleted commits may be visible. To make sure that they are un-obsoleted after
undo when appropriate, we add "draft() & obsolete()" recording. The most common
case where this matters is undoing a mid stack amend.
Differential Revision: https://phab.mercurial-scm.org/D438
Instead of the _showstats output from hg.py, we now output the args and time of
the mercurial command we are undoing.
Differential Revision: https://phab.mercurial-scm.org/D412
hg rebase, histedit, unshelve and other commands may stop in an unfinished state
because of merge conflicts or other reasons. The user then has the ability to
continue or abort. Undoing in this case is slightly tricky as for example
aborting a rebase will perform real strips and so undo will fail with an error.
This change still records these states, but flags them as unfinished and skips
over them when undoing and redoing. Hg undo --absolute does not ignore these
states in the really unlikely situation you want to go to one of them.
Differential Revision: https://phab.mercurial-scm.org/D410
Summary:
Since f33f2b5b487453a0387c80a2d736ec450696cefe, a failed `hg commit -A` will no
longer update the dirstate.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D433
Summary: This happens in case of "pull --rebase" if the source is ancestor of destination
Test Plan: see the new test, it's making hg crash without this change
Reviewers: #fbhgext, ryanmce, simonfar
Reviewed By: #fbhgext, ryanmce, simonfar
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D436
Summary:
Added config option 'prefetchdays' which indicates that commits older than
'prefetchdays' days should not be prefetched. This option is necessary to avoid
prefetch of huge amount of data. The default value is set to 14 days.
Test Plan: Ensure that unit tests pass
Reviewers: ryanmce, simonfar, durham, #fbhgext, simpkins
Reviewed By: #fbhgext, simpkins
Subscribers: simpkins
Differential Revision: https://phab.mercurial-scm.org/D420
Summary:
The test fails due to a race condition. Now the failing part of the test
output is optional.
Test Plan: Ensure that unit tests do not fail
Reviewers: ryanmce, simonfar, #fbhgext
Reviewed By: ryanmce, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D417
Summary:
The test-treemanifest-pushrebase test was failing in our continuous integration
environment with a perplexing error:
```
$ pushclients
+ abort: exporting bookmark master failed!
```
(plus some additional failures later)
I thought this should not be possible because of the redirect, but it turns out
that the order of the redirects matters:
`>/dev/null 2>&1` redirects both stderr and stdout to `/dev/null`, but
`2>&1 >/dev/null` redirects stdout to /dev/null and stderr to stdout
(TIL)
However, this was the only clue to the issue that was going on, and so it's
better to actually keep the error around, if one occurs, so I removed the 2>&1
redirect altogether.
Furthermore, the test was failing with various clients failing to push.
To increase the chance of this succeeding, I'm bumping the sleep time. Ideally,
we should wait for the server to be "ready", but I'm not certain what that means
or how to test and would like to discuss to figure it out. This hopefully will
unblock the continuous integration for now.
Test Plan: Test still passes locally; wait to see if it passes in automation.
Reviewers: #fbhgext, mitrandir
Reviewed By: #fbhgext, mitrandir
Differential Revision: https://phab.mercurial-scm.org/D415
Previously, if the system hg does not work, `helper-testrepo.sh` will skip
the test (usually `test-check-*.t`). This patch makes it stricter so a
non-functional system hg will be an error so it's less likely to be ignored.
Differential Revision: https://phab.mercurial-scm.org/D387
Undo commands where undo wasn't first, for example `hg --pager=off undo` break
multiple things, including hg redo. This change fixes this.
Differential Revision: https://phab.mercurial-scm.org/D396
Mercurial sometimes leaves bad caches. Easiest example is when updating to a
hidden commit, where hg undo will fail, but can be reproduced with many commands
(such as fold which is used for testing here).
Test Plan:
unit tests
Differential Revision: https://phab.mercurial-scm.org/D395
Summary:
amend --to is a thin wrapper around histedit, and fails if you ask it
to update the date. tweakdefaults can be configured to ask amend to change the
date. When this is the case, don't change the date when using --to, so that it
can work.
Test Plan:
Test case added here fails before the change complaining about other
flags with --to, and fails in the histedit afterwards (I'm not clear on why - I
suspect phases are significant here).
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D349
Summary: The test failed due to a race condition. Now the failing part of the test output is optional.
Test Plan: Ensure that unit tests do not fail
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D407
Adds --branch handling to the no argument redo. Also adds better branch testing
and takes a more sensible approach to an undo after an undo --branch.
Redo now restores undoredo.i's --branch field. Undo after a undo --branch is
now an absolute undo. See test cases.
Test Plan:
unit
Differential Revision: https://phab.mercurial-scm.org/D324
Strips docs of unnescerary info and sticks complex things behind --verbose flag.
In most cases hg undo and redo or hg undo --preview should be enough for the
user. Also changes --index to --step, which seems clearer.
Differential Revision: https://phab.mercurial-scm.org/D287
Changes redo to straight up undo the previous undo. This is a bit trickier than
it may seem. The previous redo capabilities are still covered in hg undo as
--index accepts negative numbers allowing you to step both forward and
backwards one step at a time. The new redo reads the linear undo log to find
out where to undo to while updating the undo/redo index allowing you to continue
from where you left off.
Differential Revision: https://phab.mercurial-scm.org/D286
Adds --index handling for --preview. With the added handling, preview also
works for redo. In order to bypass template logic, we simply change the
"undoredo.i" file and reset it afterwards.
Differential Revision: https://phab.mercurial-scm.org/D207
Allows for hg undo --preview to see smartlog like preview of what undo will do.
This will be neccesery before a general roll-out so users can see what undo will
do. This first iteration only shows what "hg undo" will do, not redo and not
--index.
Differential Revision: https://phab.mercurial-scm.org/D206
Summary: Since a blob commit does not associate with a p4 changelist, while a regular commit mirrored a p4 change has a p4 changelist number, p4fastimporter needs to know how to handle a blob commit. The solution here is to get p4basecl number (which tells it which changelist number it's based on when creating this blob commit) from the blob commit node, and import from there.
Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/test
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-blobcommit.t
$ python ../../hg-crew/tests/run-tests.py test-p4*
All tests should pass
Reviewers: #idi, davidsp
Reviewed By: davidsp
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5544046
Tasks: 20141624
Signature: t1:5544046:1502405269:9f449550d60b9d29d8be464ab1cc98500bc60cad
Summary:
Perforce encodes certain characters in filenames (see
https://www.perforce.com/perforce/doc.current/manuals/cmdref/filespecs.html)
We must decode this before we add it to Mercurial.
Test Plan:
python ../../hg-crew/test/run-tests.py test-check* test-p4fastimport*
Reviewers: #idi, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, steaphan, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5570533
Tasks: 20133877
Signature: t1:5570533:1502010300:0ef3ce0c228c61e23396b5a8ac887ac8c65812ff
Summary: Now on hg gc incremental repack is run if configured
Test Plan: Added a test case
Reviewers: simonfar, durham
Reviewed By: durham
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5583902
Tasks: 19727557
Signature: t1:5583902:1502221690:dce09112207e9e4595458d61a7b73f1210d3b012
Summary: Linux command for the date 100 seconds from now didn't work on mac.
Test Plan: Tested that new expression works on both mac and linux
Reviewers: rmcelroy
Reviewed By: rmcelroy
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5592832
Signature: t1:5592832:1502295105:eb281ee3948f29fcadbe4389d90be434751d37bf
Summary:
Now hg gc keepset includes pullprefetch and bgprefetchrevs revsets to avoid
garbage collection of prefetched in background data.
Test Plan: Added test case, also tested in *-gcrepack.t
Reviewers: durham, simonfar
Reviewed By: simonfar
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5583184
Tasks: 19727557
Signature: t1:5583184:1502208410:c247d802cf27c0143b6d7e2d95029bad5f344499
Summary:
The tree datastores have moved from the svfs to the manifestlog. Let's update
fastmanifest to use them from there.
Test Plan: Ran the tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D235
We have seen issues caused by user config file (`~/.hgrc`) having
unsupported extensions enabled. This new extension would allow us to warn
users about those problematic configs.
Differential Revision: https://phab.mercurial-scm.org/D154
Summary:
The bug was the following:
If you run hg prefetch, then hg repack, then hg prefetch, the second prefetch
downloads the same things as the first prefetch, even though the items are
already in the pack file.
That happened because Mercurial only checked if loose files exist before
prefetching(it didnt consider pack files). Now it also checks pack files.
Test Plan: Added test case, tested manually on www
Reviewers: simonfar, durham
Reviewed By: durham
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5574070
Tasks: 20797710
Signature: t1:5574070:1502124107:34cfabcfdcb81da79aff565641c9002bfe548def
Summary:
Implemented initial version of a garbage collector for repack. Garbage
collection is only performed if gcrepack flag is set in config. Currently
data that is old and not in keepset is garabage collected. The age of data at
which point it will be garbage collected can be specified in config as well.
Test Plan: Added a test case
Reviewers: durham
Reviewed By: durham
Subscribers: rmcelroy, medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5548194
Tasks: 19727521
Signature: t1:5548194:1501882489:cc775ec95aa6fafc462a46f99d790f231139ce27
Summary: This is a followup diff of this diff: [[ https://phabricator.intern.facebook.com/D5509536 | D5509536 ]]. It makes the ignored user and the constraint on time difference between a user commit and a p4fastimporter import configurable.
Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/tests/
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-gitfusion-race-condition.t
$ python ../../hg-crew/tests/run-tests.py test-p4*
All tests should pass
Reviewers: #idi, davidsp
Reviewed By: davidsp
Subscribers: wlis, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5531404
Tasks: 20141882
Signature: t1:5531404:1501866435:25686443d99a2b96f8e8a7fa9e3f660ba8c8393e
Summary:
Change fb-hgext's sparse to treat patterns correctly (this was brought to
my attention by @martinvonz on the mailing list).
This patch makes sure that:
```
reporoot/subdir$ hg --include **/file
```
results in `subdir/**/file` being included rather than `subdir/`.
Test Plan: rt
Reviewers: mjpieters, durham, #fbhgext
Subscribers: martinvonz
Differential Revision: https://phab.mercurial-scm.org/D225
Summary: Before this `test-check-code-hg.t` failed on `undo`-related things.
Test Plan: - rt
Reviewers: felixmerk, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D226
Adds smart indexing to localbranch undoes. This eliminates the mental burden of
the user of keeping track in what order and when changes where made. Drawback
is that it raises the computational complexity from the number of draft
commits to draft commits times how many repo states you are undoing. Common use
case should be to undo a small number of changes, so this is acceptable.
hg undo -b changectx finds the closest pertinent change and undoes that. -b
with -n is not supported. The reason it is not supported is that local branch
level undoes are delta specific and not state specific, which in essence means
that running hg undo -b # twice is not guaranteed to give you the same resault
as running hg undo -b # -n 2. We could run -b multiple times for a -n, but the
cost of a -b increases with a larger -n (which isn't the case for a standard
undo), and abort handling would be more complicated (I'm not sure how well we
can roll back a tree of obs markers?). In essence -n with -b is not that
usefull a feature (bc perf limits) and would potentially require a decently large
amount of time to implement correctly.
Also adds redo -b since this command now makes a lot more sense when we use the
smarter indexing. Adds logic to seperate undoes and redoes in different
branches. You can perform relative undoes and redoes within the latest scope,
while undoes and redoes within a new scope will start at the present (absolute)
state.
Differential Revision: https://phab.mercurial-scm.org/D186
Add the ability to undo changes within one 'localbranch'. In the future, this
will probably become default behavior. Undo -b changecontext will undo changes
belonging to the local branch identified by the changecontext (see revset
localbranch). Based on obs markers we can identify connected commits that we
in turn reveal or hide outside of this localbranch. This undo allows users to
work on multiple branches independantly.
Currently, indexing for undoes is still on the repo level. This isn't good
from a ux experience. Next up would be localbranch level indexing logic and
redo logic.
Differential Revision: https://phab.mercurial-scm.org/D160
Adds localbranch revset to be used for localbranch undos. A localbranch is a
set of draft commits that are connected via draft commits. Any draft commit
within a branch, or a public commit at the base of the branch, can be passed as
an argument to localbranch(). This will be necessary for selecting the scope
for a localbranch undo. Also fixes oldraft() output when used with other
revsets. Previously olddraft() would ignore operators such as and because of a
missing the necessary handling.
Differential Revision: https://phab.mercurial-scm.org/D159
Summary: We need a check-code for that.
Test Plan: tested on my laptop
Reviewers: #fbhgext, ryanmce, ikostia
Reviewed By: #fbhgext, ryanmce, ikostia
Subscribers: ikostia
Differential Revision: https://phab.mercurial-scm.org/D222
Summary:
We've spent a lot of time hacking around the outputs of hg in jf (a new
tool we use at FB to interact with our code-review system). We've figured out that it
could be all avoided and made cleaner with simple hg extension that dumps all
the data we need in a format that we can easily consume.
Test Plan: see attached test
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D205
It's breaking Linux tests. I spent some time reading the shell script but
cannot figure out what's wrong quickly, so backing it out to unblock
contbuild now.
Summary: - update the scm-prompt.sh script to display when there have been local changes that haven't backed up in four hours
Test Plan: arc unit tests/test-scm-prompt-hg.t
Reviewers: rmcelroy, stash
Reviewed By: rmcelroy
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5498437
Tasks: 18349390
Signature: t1:5498437:1501083894:8a8872df2c6492006c8a76c365d53a3b9a41933a
Summary:
- change the infinitepush extension to record additional state when the a backup occurs.
- useful for other tools (scm-prompt, nuclide) to indicate when a backup hasn't occurred recently
Test Plan:
- cd facebook-hg-rpms/
- source hg-dev
- cd fb-hgext
- arc unit
Reviewers: rmcelroy, stash
Reviewed By: stash
Subscribers: rmcelroy, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5321221
Tasks: 18349390
Signature: t1:5321221:1501271966:6698785e0714e3ecf7e1e2684d1e62e52ac0f1a0
Summary: My hostname contains an underscore and that causes these tests to fail.
Test Plan: arc unit tests/test-infinitepush-logging.t
Reviewers: stash
Reviewed By: stash
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5498213
Signature: t1:5498213:1501229709:6cd63cd0e7e644388d21f516893dcd8fb48e75de
Summary:
Keep `showupdated` commit messages limited to a 50 character width,
with a "..." ellipsis to signify that the message was trimmed.
Test Plan: Added a test.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Differential Revision: https://phab.mercurial-scm.org/D217
Summary:
Symlinks must not have newlines at their end. However reading the
content from Perforce, it might contain a newline, so we now strip it.
Test Plan:
python ../../hg-crew/tests/run-tests.py --keep-tmpdir test-p4fastimport-import-modes.t
Reviewers: #idi, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5535514
Signature: t1:5535514:1501601075:20ce811a92d1d5b5a973e05db1d2110599c5ef52
Summary:
The debug output of p4fastimport depends on the users environment (e.g. cvs
tools installed or not). Glob the corresponding output
Test Plan:
Tests didn't run before on my machine,
now they run
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5535504
Signature: t1:5535504:1501613540:f6f42e97eb0e7515146eea888bfd758759d69f71
Summary:
Adds a new revsetpredicate: `age()`, which matches changesets that are
older or younger than a certain age.
Test Plan: Add new unit test for the predicate.
Reviewers: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D196
Summary:
Allow summarisation of commits that have not been backed up
by infinitepush.
1. Add a template keyword (backupstatus) which evaluates to
one of "Public", "Backed up", "Backup pending", or
"Not backed up" depending on the backup state of the
commit. Commits are pending for 10 minutes, after which
they are declared not backed up.
2. Add a summary to the end of smartlog that shows the
number of commits that are not backed up.
Configuration options allow the addition of an education
message to inform users what to do about their failing
backups, and the message can also be suppressed.
Test Plan:
New unit test for both the keyword and the summary.
Reviewers: #fbhgext, stash
Subscribers: mitrandir, quark, akushner
Differential Revision: https://phab.mercurial-scm.org/D184
Summary:
Previously fastmanifest.usecache=False would only prevent the reading of the
fastmanifest cache, but the cache was still created. This created excess IO on
services that frequently recreated the repository.
Test Plan: Added a test
Reviewers: #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D155
Summary:
There is an existing template "diffstat" which gives a minimal and not
very useful output containing the overall number of files that changed, total
number of lines inserted for all associated files, and total number of lines
deleted for all associated files.
On the other hand, the output from the command line option "stat" is much more
descriptive. Therefore, users end up using commands of the form
hg log -r . -T '{author}{date}' --stat
When they would have preferred something like
hg log -r . -T '{author}{date}{stat}'
This change adds the template "stat" which will allow for the desired behavior.
Test Plan:
# Added a new test test-template-stat.t
# Ran arc unit
Reviewers: #sourcecontrol, quark
Reviewed By: quark
Subscribers: akushner, medson, mjpieters, quark, rmerizalde
Differential Revision: https://phabricator.intern.facebook.com/D5521665
Tasks: 12422741
Signature: t1:5521665:1501287682:2afaea56b3dc863c52e6300c6bc482ae132a6a61
Summary:
When a user commits changes to a git-fusion repo, it pushes commit to perforce as user git-fusion-user, and then update the commit's author to be the actual author. We want p4fastimporter to skip the git-fusion-user commit and import the commit by the actual author. This diff sets the basic workflow, where we specify the constraint to be commits by git-fusion-user that is less than 30 seconds old.
// TODO: make the constraint configurable.
Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/tests/
// test race condition
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-gitfusion-race-condition.t
// test all
$ python ../../hg-crew/tests/run-tests.py test-p4*
Reviewers: #idi, davidsp
Reviewed By: davidsp
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5509536
Tasks: 20141882
Signature: t1:5509536:1501521842:17dd767615b8218980eda68d4113433d30805d92
Summary:
This option was intended as temporary and it was enabled for long enough time.
Now let's delete it.
Test Plan: Run unit-tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D195
Summary:
We had a few troubles where fastlog failed with a weird error and people got
incorrect log output. While I still don't know why fastlog failed in the first
place, I've found the reason why log output was truncated. And this diff fixes
it. See the comments in the code for details.
Test Plan: Run unit-test
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Subscribers: simonfar
Differential Revision: https://phab.mercurial-scm.org/D193
Summary: Add `--delete` to the list of sparse options that understand cwd-relative paths.
Test Plan: rt
Reviewers: mjpieters, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D197
Summary: Let's be friendlier to our friends on Windows.
Test Plan: rt
Reviewers: mjpieters, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D194
Previously, inhibit may use a wrong date when writing markers. This patch
fixes that. Also add a test to check the date and make sure `revive` takes
effects inside a transaction.
Differential Revision: https://phab.mercurial-scm.org/D182
Summary:
This command helps the user to bring back the commits to life with an explicit
command - wihtout the need to change working copy parent or create bookmarks.
Test Plan: see test
Reviewers: #fbhgext, durham, kulshrax, quark
Reviewed By: #fbhgext, quark
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D179
Summary:
We have two commands for hiding commits:
* strip - which has a lot of legacy options and legacy name
* prune - which allows for creating arbitrary obsolescence markers
Both of them have complicated UI and are suboptimal experiences for unadvanced
user. The `hg hide` command is very simple, does one job and does it well.
Test Plan: see test
Reviewers: #fbhgext, durham, quark, kulshrax
Reviewed By: #fbhgext, quark
Subscribers: akushner
Differential Revision: https://phab.mercurial-scm.org/D178
Summary:
We didn't check for sanity when the user asked for hg githelp -- git -
oops. Fix the args test to catch you if you ask for help for git, as opposed to
(say) git commit.
Test Plan: Ran the new test cases.
Reviewers: #fbhgext, ikostia
Reviewed By: ikostia
Differential Revision: https://phab.mercurial-scm.org/D183
Summary:
Adding a knob to control how we perceive supplied paths is a good intermediated
step towards getting every user to use cwd-relative paths.
Test Plan: - rt
Reviewers: mjpieters, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D175
Summary:
Users and particularly automation can benefit from having the new
revision hashes as part of the output of rebase and other operations that
update nodes. Right now, hacks such as getting the tip revision are used to get
that information.
Test Plan: unit tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce, durham, stash, quark
Differential Revision: https://phab.mercurial-scm.org/D173
Summary:
--retry can be used instead of --continue when histedit failed on "exec" (due to it returning a non-zero exit code) and the user wants to repeate that command rather than continuing past it
--show-plan will print the remaining plan of histedit during an interrupted histedit
Test Plan: cd fb-hgext/tests/ && rt
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Subscribers: stash, quark
Differential Revision: https://phab.mercurial-scm.org/D176
Summary:
Core mercurial has a much better "nocheck" option now that we should just start
using. It's better and it's built-in!
Test Plan: Updated tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D164
Summary: Current behavior does not even do what it says, let alone the right thing.
Test Plan: - rt
Reviewers: #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D174
This allows us to log what nodes are pinned by what commands. So we can
manually investigate what was happening when we get user complaints.
Differential Revision: https://phab.mercurial-scm.org/D158
Summary:
There was a report from an infinitepush user who complained about
`hg update remote/scratch/book` failing to pull the bookmark, while
`hg update scratch/book` pulling fine. It confuses users because they see
`remote/scratch/book` in smartlog.
On the other hand let's not allow `hg pull -B remote/scratch/book` to stay
consistent with remotenames.
Test Plan: Slowly run tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D172
Summary:
If remotefilelog server cache files are truncated, when the server
returns these files to the client, the client will crash trying to
decompress them. Detect truncated files and treat them as cache
misses.
Test Plan: Add unit test for truncated server cache files.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D170
Some power user workflow requires `uncommit` to leave an empty commit so
they can run `hg amend` afterwards. I don't find easy alternatives so let's
allow that if `ui.allowemptyconfig` is set.
Note: `ui.allowemptyconfig` is an internal config that is not documented for
end-users. Core Mercurial seems to be trying to prevent the empty commit
case from normal users (like, comment disallows that, rebase will skip a
commit if after rebasing it becomes empty). So it seems better to still use
that undocumented config instead of a more discoverable flag.
Differential Revision: https://phab.mercurial-scm.org/D156
Summary:
We've seen a couple of issues when there are lots of public commits between a
head and master bookmark. Smartlog tries to draw all of the public commits
and drawing it can be too slow. See example below
```
o - some commit that smartlog wants to draw
/
o
.
. -- many commits
.
o - master bookmarks
```
This issue happens often while using infinitepush extension.
Let's fix it by drawing just one public commit between a head and master.
We could of course avoid drawing this public commit at all, but in that case
output would be smth like
```
o - some commit that smartlog wants to draw
/
o
| - many commits in betwee, but user doesn't see it because there are no dots
o - master bookmarks
```
Test Plan: Slowly run tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D168
Summary:
When fully uncommitting a commit on top of a public commit, uncommit
erroneously marks the new current commit with the same phase as the old
commit. It should only do that in the case of a partial commit,
where the new current commit is a new commit.
Test Plan: Add tests to test-uncommit.t.
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D165
Summary:
Adds user (-u), date (-d) and line number (-l)
If you use Phabricator, also adds Phabricator diff ID (-p)
Test Plan: run-tests.py -l test-githelp.t
Reviewers: #sourcecontrol, mitrandir
Reviewed By: mitrandir
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5469590
Tasks: 11078001
Signature: t1:5469590:1500633342:7be15f60e371dab7016ec44866ea369c696cb0a8
The test shows that restack moves "D" twice while it could have moved it
only once. It is a side effect when I spent 1.5 hours on investigating a
user report that a commit was duplicated with `amend --rebase` somehow. I
didn't have conclusion about that report (maybe it's because old inhibit was
used?), but thought it's nice to have this interesting test case added.
If `hg rebase -r C -d B2 -q` were moved after `hg commit --amend -m B3`,
then restack will move "D" only once.
It can be solved by using another topo sort, which was planned in the
multi-dest series [1].
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-June/100247.html
Differential Revision: https://phab.mercurial-scm.org/D163
I think the code works well but it might leave unnecessary pinned nodes
around. This patch makes it more conservative so that only a movement
(update or bookmark) on an obsolete commit would write new pinned nodes.
Differential Revision: https://phab.mercurial-scm.org/D157
Summary:
If bgprefetchrevs is specified in config, background prefetch will be executed on
update and commit commands as well as on other commands which use update or
commit. Background prefetch will fetch revisions specified in config and if the
repack flag is set will also execute a repack.
Test Plan: Added test cases
Reviewers: simonfar, durham
Reviewed By: durham
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5454939
Tasks: 19727407
Signature: t1:5454939:1500551182:e9cce84f6dc98182b5cb30faeb811fd7fa5e22b0
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
Summary: They no longer conflict, in fact we no longer use this config in this repo.
Reviewers: quark
Reviewed By: quark
Differential Revision: https://phab.mercurial-scm.org/D39
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: 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: 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's a useful piece of information for Mononoke (see attached task).
Test Plan: arc unit
Reviewers: #mercurial, jsgf
Reviewed By: jsgf
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5310026
Tasks: 18812931
Signature: t1:5310026:1498234999:0c06a30bd659d6a1d3cedc28252f17dd1fc93dc8
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:
Previously pushbackups failed when it tried to unlink non-existent infinitepush
backup state file. This diff fixes it.
Test Plan: arc unit
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: medson, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5309684
Signature: t1:5309684:1498210504:49af716dbb4e7e1875e8a2b7ee4b40fe28ceefc1
Summary:
arc unit failed for me with
{P57551010}
Let's exclude mysql module from modcheck
Test Plan: Change infinitepush files and run arc unit, make sure it doesn't fail
Reviewers: quark, mitrandir
Reviewed By: mitrandir
Subscribers: medson, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5300890
Signature: t1:5300890:1498125580:166141adbc211726e679ea48897a47a73835ed22
Summary:
When adding manifests, we keep the mutable packs open for the duration of the
transaction. The old code had a bug where it didn't realize the pack files were
already open and it would open new ones. This meant only the last pack file was
finalized and the rest were left open as unfinished temp files.
This patch fixes it and adds a test.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5297004
Signature: t1:5297004:1498086398:5cbe6e6c78d02f09d341417ec3a745853dac9849
Summary:
Previously the wireprotocol allowed for fetching a specific sub-tree,
but the server's implementation didn't handle it. This caused issues when the
user made a local commit whose trees had references to public trees, then the
user deleted the cache trees and refilling the cache failed.
The current solution is to just serve the entire tree, since the current native
code treemanifest implementation can't serve sub-parts of the tree at the
moment. This is expensive, but should be pretty rare though since the client
usually the entirety of a tree if it's going to keep the root.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5296211
Signature: t1:5296211:1498086921:3e7be99b8581c1fdf507a2fe560b4c796835cdf3
Summary: Currently seconds are sent to logging for elapsed time. Given the that most values are 0, 1, 2, or 3 seconds, this change adds some better signal. Not reusing the elapsed field, instead introduced elapsed ms.
Test Plan:
arc unit
modified test-infinitepush-backup-logging.t to include the new elapsedms field
Reviewers: stash
Reviewed By: stash
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5292576
Tasks: 19557691
Signature: t1:5292576:1498059638:8461a71398a41bf741384ddcda15d5c016633d66
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:
When testing code in this repo, it's an easy mistake to import a module of a
same name installed in the system or specified by `PYTHONPATH`. This diff
adds a test module to detect that. It's included in `unit.py` so `arc unit`
will be able to find such issues
It will be more effective if all our extensions are moved to hgext3rd.
Test Plan:
Append a blank line to every `.t` files, and run `unit.py` with `hg-dev`
environment, and make sure nothing got reported.
Reviewers: durham, #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5274454
Signature: t1:5274454:1497976474:1b25881f022e148b89829ed3f4d6a79437f2533f
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:
Previously, if we were fetching a treemanifest we would only search downwards
for commits for possible base trees (so we could download only the new parts of
the tree). With this patch we will also search upwards in the changelog. This
means that running 'hg log -r master --stat' will efficiently download the tree
for `.^` since it will be based against `.`.
Also fixes an issue with on demand downloads looking for base revs by starting
at the wrong changelog rev (they used the manifest rev number instead of the
changelog linkrev number). The same test covers this.
Test Plan: Added a test
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mitrandir, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5279552
Signature: t1:5279552:1497980967:a2d6003b126858cc05eb0095cd68c12db9670e29
Summary:
If the repo being repacked has commits being pushed, it's possible that the
repack will encounter file revisions who's linkrevs don't exist in the inmemory
changelog. Let's set an upper bound on what linkrevs to repack so we can only
process revisions who's commits we can see.
Test Plan: Added test
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5279171
Signature: t1:5279171:1497911997:a48c56abebd14a1c066c9fc1ee4098f813d062df
Summary:
Adds output that tells how many trees were downloaded, and how long it took.
Only appears if remotefilelog.debug=True is set.
Test Plan: Updated the tests
Reviewers: #mercurial, phillco
Reviewed By: phillco
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5278596
Signature: t1:5278596:1497926493:82a01b3b49e9ff87e51ac3c5cd0e4be952020ba0
Summary:
Final part: launching debugfillinfinitepushmetadata in the background. We
intentionally don't wait for it's completion in order not to slow down pushes.
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mitrandir, quark, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5265325
Tasks: 19103180
Signature: t1:5265325:1497886939:6c306c08b240373ea43a7fc868b17ef776258cf9
Summary:
When committing a node which already exists, the linkrev provided to filelog
is actually wrong (len(changelog)). The upstream Mercurial will not update
existing file revisions but remotefilelog will.
The fact that linkrev being wrong triggers the ProgrammingError added by
D5061330. This diff detects that case and avoid writing bad linkrevs or
raise ProgrammingError.
Test Plan: Added a test.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5278060
Signature: t1:5278060:1497910883:b8c3b6281ad9c0a516b942ba8ca41c51801b2d6b
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
aa578bb62ed35bcd0e433a8b4a65539e8bfb0548 upstream commit introduced new default
for profiling.showmin option and changed test-check-config.t file. We need to
do the same.
Summary:
Add an option to limit the number of file entries in the metadata field. This
is to avoid huge codemods to eat up all the space.
Depends on D5255883
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5264202
Tasks: 19103180
Signature: t1:5264202:1497630109:05d684db34578e309e0bbad314165e66d1f23ce9
Summary:
We may want to fill infinitepush metadata for many commits at once.
Let's make it possible to pass many nodes to debugfillinfinitepushmetadata
Depends on D5255670
Test Plan: arc unit
Reviewers: #mercurial, mitrandir, quark
Reviewed By: quark
Subscribers: mitrandir, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5255883
Tasks: 19103180
Signature: t1:5255883:1497629860:26332e3cc115881bca158664014ce48087d99215
Summary:
Also need to use `with index` to make sure that transaction closes.
Depends on D5255664
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mitrandir, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5255670
Tasks: 19103180
Signature: t1:5255670:1497557000:906a39810931d92f30c6d6b8e5bfc28e0c888594
Summary:
I've forgot to add it in the previous diff. We also want to know copies
information and status (added, modified, removed).
Test Plan: arc unit
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters, medson, azich, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5255664
Tasks: 19103180
Signature: t1:5255664:1497542963:b552c07d261067f426d7af7a29d2f02c1917394c
The extension was removed so the test needs update. It wasn't discovered
because the system `allowunstable` was used. `check-code` logic will be
updated to make it harder to use system extensions.
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:
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 diff removes "unset HGRCPATH" to try to run tests in a more
controlled environment. And skip the test if system HG looks broken.
Test Plan: arc unit
Reviewers: simpkins, #mercurial, stash
Reviewed By: stash
Subscribers: net-systems-diffs@fb.com, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5263484
Signature: t1:5263484:1497604378:28ec94c33ba77680c8d2325a8fa36457e0eb8c91
Summary:
This removes Cython as a build dependency as requested by our users.
Added a test to prevent check-in files with `/home/`.
Modified check-code to skip checking Cython generated files.
Test Plan:
Run `make clean local` with Cython installed and uninstalled.
Also run `make clean local` with `USECYTHON=1` and `0`.
Reviewers: #mercurial, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5252935
Signature: t1:5252935:1497525190:402798077d44e39e24fcb037535ec7ffd1af9c4b
Summary:
Special command that fills optional metadata about infinitepush nodes. For now
it's info about changed files + info about how many lines were
added/removed. Since information is saved in json format it's easily
extensible.
It's a separate command so that we will be able to run it asynchronously:
during infinitepush push separate `hg debugfillinfinitepushmetadata` process
will be started. Push process won't wait for `debugfillinfinitepushmetadata`
process.
sqlindexapi will be implemented in the next diffs.
Test Plan: arc unit
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson, azich, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5237547
Tasks: 19103180
Signature: t1:5237547:1497397211:569d1ffe3be37c8d14fb7e07e42cd085ad5686d4
Summary:
Previously infinitepush lookup function didn't call original lookup function.
It made it impossible to work with extension like gitlookup that also
overwrite lookup. This diff fixes it.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5246683
Tasks: 17733144
Summary:
Let's add a special field that would store arbitrary metadata in json format.
It can be used to store, for example, lists of changes files, file diffs etc.
Depends on D5236375
Test Plan: arc unit
Reviewers: #mercurial, azich
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5236394
Tasks: 19103180
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.
The 'node' argument points to the last new changeset. Mercurial documentation
state that it should be the first new changeset.
This will be fixed with the following changeset
Summary:
Previously, if a tree needed to be downloaded on demand (like during hg
show), it would download the entire tree. With this patch, we look backwards in
the changelog for a tree we already have and then download only the new parts of
the tree.
Test Plan:
The existing demanddownload test changed because of this. I've added
more output to the test to show that only new items are downloaded (to be
specific subdir/ is not downloaded again since it did not change).
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters, medson
Differential Revision: https://phabricator.intern.facebook.com/D5210268
Signature: t1:5210268:1497299426:195517184d53396849d0ba8c75216d07741e5863
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: `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:
There is a problem with socket.gethostname() because it can return
inconsistent names. See attached task for details.
Instead this diff lets us specify any hostname.
Depends on D5180633
Test Plan: arc unit
Reviewers: #mercurial, simpkins, tja
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180665
Tasks: 18528165
Summary:
Let's add an option that can be used to trigger full clean backup.
It can be useful in many situations, for example, in case of bug in
infinitepush backup or if the naming scheme of backup bookmarks were changed.
Test Plan: arc unit
Reviewers: #mercurial
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180390
Tasks: 15389402
Summary:
We do not want to switch people to obsshelve and then find out that their
traditional shelves cannot be unshelved.
Test Plan: - check that added test passes
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180998
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:
See bottom commit of the stack for the motivation.
This commit copies obsshelve-related tests from hotfixed core and cleans them
up a little bit.
Test Plan: - run just added test
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5180981
Summary:
With upstream bab25235cfb5daf578a598bd7ae08f7a70ef7acd `hg strip` also strips
markers too. This diff just accepts the test changes since they seems not dangerous
Test Plan: arc unit
Reviewers: #mercurial, kulshrax, simpkins, quark
Reviewed By: quark
Subscribers: net-systems-diffs@fb.com, mjpieters, medson, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5185690
Signature: t1:5185690:1496700479:a230a2861c8d3cafda3867c81b8fc90a7cfcc4df
Summary:
Previously, we would only look at the node parents to determine what the base
node would be for a prefetch. This didn't work so well when we started
prefetching arbitrary revs, like only prefetching master. This patch allows us
to scan the changelog back a bit to find the nearest base tree.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5108686
Signature: t1:5108686:1495565589:1729bfae7198e8db2223446b81e3bdbf77cf3db6
Summary:
This adds a config option that allows clients to prefetch only certain trees
after a pull. This is useful if the user wants to download just master. A future
patch will make it only download the portion of the master tree that is new.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5108677
Signature: t1:5108677:1495565526:a443c41ccbf55e529c93aa0c021849396d611ac6
After upstream commit bab25235cfb5daf578a598bd7ae08f7a70ef7acd strip now also
deletes obsmarkers that are related to the stripped commits and saves them in
the bundle.
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:
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:
This diff makes the tests use the vendored directaccess and inhibit instead the
foreign ones.
Test Plan: arc unit
Reviewers: #mercurial, sid0
Reviewed By: sid0
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5142981
Signature: t1:5142981:1496173851:3a8f3a1c689711dbef517c893bf72c90ab144761
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:
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:
Previously `_getrevstobackup()` would load manifest for each commit in memory
only to check if a file was deleted in this commit or not. Manifest can be
quite big and since every loaded flatmanifest is cached in fastmanifest then
memory usage can be huge.
Since we are doing this only to check if there are any commits that were
downloaded to the client without filelogs and then were stripped server-side.
This cases are rare and it would be easier to track these commits in the
config file.
Test Plan: arc unit
Reviewers: #mercurial, mjpieters, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5111372
Tasks: 15389402
Signature: t1:5111372:1495848867:4028bd48313ac0e2022c3695195bedc6eda80abf
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:
There are two `convert.h`. This patch unifies them and does cleanups so it's
a valid header file which could be included by multiple .c and .cpp files
and linker won't complain re-definition (by adding `static` to everything).
Besides, reformat the code so it could pass check-code. Also fix a compiler
warning about comparing an unsigned integer with a signed integer.
Test Plan: `make clean local`. It still builds.
Reviewers: durham, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5113550
Signature: t1:5113550:1495565413:e399f898ac513e64af37dab5daf55cedbabfc703
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:
We now use setup.py to do the build so this is outdated. It does not seem to be
useful so just remove it.
Test Plan: eyes
Reviewers: durham, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, ttung, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5112853
Signature: t1:5112853:1495561149:a4ee408e1fe06dea32f96ae93abb38d7d21d3619
Summary:
statprof is now part of core hg. And core hg will import its own version
instead of the external one. So it's no longer to have a separate version.
I did a comparison. The version in fb-hgext is falling behind - it lacks of
Chrome support. The upstream version is also cleaner in terms of Python3 code
standard and error handling.
Test Plan: eyes
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5112666
Signature: t1:5112666:1495562274:7e1ca7d964bf617695dbefd59c3843a3ebf47f9e
Summary:
Let's log whenever one merge parent was deleted and another was modified.
It will help us find out how much disabled copytracing affects users.
Test Plan: test-copytrace-errormsg.t
Reviewers: #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D5103311
Tasks: 18508761
Summary:
First step to get better copytracing. For now let's just change merge error
message to suggest re-running command with enabled copytracing.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5102174
Tasks: 18508761
Summary:
Wrap the capabilities wire protocol command to print the hostname to stderr.
This commit contains the implementation of the extension but not code to register it on a particular repo.
Test Plan: `rt`
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: durham, wez, stash, simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5087634
Tasks: 16758829
Signature: t1:5087634:1495498748:213a32c5c474145371bbbc43b0463dee31868a9a
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:
The `cmp` logic does not look special from the original `basefilectx.cmp` so it
could be removed. This means we will benefit from LFS's override of
`basefilectx.cmp` and have a fast path for LFS binary diff.
Test Plan: Added a test. Make sure the old code fails that test.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5100529
Signature: t1:5100529:1495468055:ff7fa30f3277b942bf49ba1e9b8764effacd972a
Summary:
Previously our data packs would have incredibly long delta chains, where to read
the last entry in the file you had to read every previous delta all the way to
the beginning. This was very expensive for chains of 2+ million deltas. Let's
add a config option to limit how long the deltas get, and for now we'll default
it to 1000.
Test Plan: Added a test
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5095603
Signature: t1:5095603:1495213707:737d63129cf459ad6927a1f4deb0dda5a8ce0a7f
Summary:
The newly added config option could skip LFS revision checks. Let's use it
so `hg verify` passes.
Test Plan: arc unit
Reviewers: #mercurial, davidsp
Reviewed By: davidsp
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5091709
Signature: t1:5091709:1495163508:3f36dfa221ab0896e1dc49d30c762d7957ac9826
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
This test had non-deterministic ordering, which caused it to fail sometimes.
Let's make the test check more explicitly, by checking that the bad commit hash
is not present.
Summary:
One of the heads may point to filtered commit and isbackedup command fails in
this case. Let's use repo.unfiltered()
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5001977
Signature: t1:5001977:1493907725:f6a138bd4e2cae48b64152fceaf73660ea91f43b