We no longer use this experiment and the upstream refactor breaks it. Let's remove it.
Test Plan:
all sqldirstate tests pass now
Differential Revision: https://phab.mercurial-scm.org/D944
When a file changed to include a flag and then the flag is removed we did not
correctly remove the flag. We now correctly set flags for all revisions.
Differential Revision: https://phab.mercurial-scm.org/D920
Summary:
This diff caused a regression - clients may not have a tree manifests entries
for old commits. That causes infinitepush fail with
```
KeyError: ('', 'f6db63080ed0d9a81adf2cb266646cf5cf73bb79')
```
Test Plan: Run infinitepush with this diff reverted, make sure it doesn't fail
Reviewers: #fbhgext, ryanmce, durham
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D921
Summary: The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.
Test Plan: Run test-remotefilelog-linknodes.t
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D841
Summary: The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.
Test Plan: Run test-remotefilelog-linknodes.t
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D839
Summary:
The goal of the whole series is to have logging around linknode fixup. It's a slow operation, and we have two heuristics to make it faster. Unfortunately we have no idea about how well these heuristics actually help. This series of diffs aims to fix this problem. After this series is landed and logging is enabled, I hope that we can find out if we really these heuristics at all.
Let's log more data to make it easier to analyze where and how often does
linknode adjusing happen.
Test Plan: Run test-remotefilelog-linknodes.t
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D838
This is a simple `rt -i` fix for changes caused by upstream 83b647ce1cec and
976f5a9c1fd2. We probably want to change our template implementation to
de-dup hashes in the future.
This diff adds an option --cwd-list to hg sparse. This will return the
contents of the current directory. The files that are in the sparse profile are
annotated with a '-' indicator.
Test Plan:
Tested by running the command 'hg sparse --cwd-list' in various folders.
Differential Revision: https://phab.mercurial-scm.org/D731
Summary: Regression that wasn't tested by the tests before
Test Plan: This is now tested with a new test
Reviewers: #fbhgext, mjpieters
Reviewed By: mjpieters
Differential Revision: https://phab.mercurial-scm.org/D823
Summary:
I think this is a better way of surfacing this warning. It also allows
us to tweak the message so we can point at new documentation I have already
written up.
Test Plan: Updated test
Reviewers: #fbhgext, mbthomas, durham, singhsrb
Reviewed By: #fbhgext, mbthomas, durham, singhsrb
Subscribers: singhsrb, quark
Differential Revision: https://phab.mercurial-scm.org/D812
D802 added two test cases in the test but the test cases are only used
for a very little portion of the test and therefore, result in needless double
execution for most of the test. Therefore, this commit removes the test cases
and instead, handles the different cases by passing the corresponding config
option.
Test Plan:
ran test-tweakdefaults.t
Differential Revision: https://phab.mercurial-scm.org/D814
Add a --sparse option to `hg diff` which filters the diff to include only files
that are part of the sparse profile.
When files are moved or copied across the sparse profile boundary, they will
show as added or removed (for moves) in the diff. This is the same behaviour
as `hg diff --root`.
Test Plan:
Expand `tests/test-sparse-diff.t`
Differential Revision: https://phab.mercurial-scm.org/D797
When commands like 'diff' request the contents of files from a workingfilectx,
normally this is satisfied by reading from disk. For files outside the sparse
checkout this doesn't work, so instead we must return the content from the
working copy parent.
Test Plan:
`tests/test-sparse-diff.t`
Differential Revision: https://phab.mercurial-scm.org/D788
Summary:
Adding a config to control (only enable/disable for now) developer
warnings. This allows disabling the warnings on platforms like servers.
Test Plan: Updated and ran test-tweakdefaults.t
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Differential Revision: https://phab.mercurial-scm.org/D802
Summary:
The _adjustlinknode function in remotefilectx currently has a slow case where
it must prefetch history from the server to lookup the correct linkcode.
This change makes use of fastlog (if enabled for the repo) to speed up the
linknode lookup as fastlog will already have the correct linkrev. If fastlog
is not enabled or the fastlog call fails for some reason then it will fall
back to the old method.
Test Plan: Added new test cases in test-remotefilelog-linknodes.t
Reviewers: ikostia, stash, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D620
This makes the client side pushes also include tree packs in the push.
Also adds a test to see that the tree parts round trip between two tree-only
clients.
Differential Revision: https://phab.mercurial-scm.org/D721
Summary:
If you're working n multiple terminals on the same repository, it is
often useful to know if a command you're about to run might block due to an
already-held lock on the repository. This upgrade to scm-prompt gives the
user this information.
Test Plan: updated the test
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Subscribers: stash
Differential Revision: https://phab.mercurial-scm.org/D790
With rules of nested paths, the order of rules matters.
Note: this does not make dirsync handle recursive changes. i.e. a mirror
from path1 to path2 won't trigger a rule matching path2.
Differential Revision: https://phab.mercurial-scm.org/D770
Previously, undolog runs for every command, which sometimes adds unwanted
noticeable overhead like `hg status` with a large obsstore. This patch makes
undo smarter to only log commands that actually write things.
This is done by making undolog only run for transactions, updates (legacy
code that does not require a transaction). Tests are changed to reflect
`hg status` does not trigger undolog, and the new code seems to work better
with chg.
Differential Revision: https://phab.mercurial-scm.org/D739
The notbackedup revset predicate still has performance problems when the set of
not-backed-up changesets includes some that are completely disjoint from the
set of backed-up changesets.
Rather than trying to express it as a combination of other expressions,
implement the revset calculation directly. This allows us to also stop as soon
as a public commit is encountered, which should be faster in all cases.
Test Plan:
Expand tests to cover more complex scenarios. Test perf on a larger and older
checkout of a big repo.
Differential Revision: https://phab.mercurial-scm.org/D764
Summary:
auto-rebasing stuff during metaedit doesn't really work well for histedit.
Let's specialcase it
Test Plan: see test
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D747
When calling prefetch in remotefilelog, also prefetch lfs
files.
We are using the same hook mechanism that remotefilelog is already using
for LFS by having remotefilelog call into LFS.
Test Plan:
run tests on test-lfs-remotefilelog-prefetch.t
Differential Revision: https://phab.mercurial-scm.org/D732
Summary: "hg hide" is the user friendly command for hiding commits
Test Plan: ran tests
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D725
Summary:
Previously we ran auto backups in txnclose hook. But commands like histedit and
rebase create many transactions, and that means that lots of backup processes
are started at the same time. That means that sometimes backup processes use
too much memory.
Instead let's start it once per command if any transaction was opened
during the command.
Test Plan:
Run unit-test.
Run histedit with autobackup enabled, and make sure just one backup process
was started.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D678
Upstream has changed local bundles to use the highest available changegroup
version, which means we're using changegroup3 for strips now. So we need to
handle that in shallowbundle.
Summary:
This functionality allows to add delays between background prefetches after
operations that change the working copy parent. By default background
prefetches will be run no often than every 2 minutes, but this is configurable.
This allows to reduce the load on CPU(because prefetch is followed by repack).
Test Plan:
Tested manually on fbsource repo by running hg co bookmark several
times and ensuring that only 1 background prefetch is running if 2 minute
timeout has not expired.
Reviewers: durham, simonfar, ryanmce, #fbhgext
Reviewed By: simonfar, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D712
Summary:
The gitlookup extension allows for only requesting the complete file
from the server. This leads to download of large files (hg-git map file
specifically in this case) when only the missing chucks of the file would have
sufficed.
This commit makes changes to allow for downloading only the missing parts of
the map file. A config option 'onlymapdelta' has also been added to allow for
switching between the two different modes of operation: serving complete file
and serving only the missing chunks. The tests were subsequently updated to
cater to the new scenario and also, checking for interoperability of the two
modes.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Subscribers: durham
Differential Revision: https://phab.mercurial-scm.org/D695
Summary:
test-git-getmeta.t has some basic tests to check that the git metadata
syncing works as expected. I have added some tests for more complicated
scenarios for robust testing. Also, I did some refactoring of the test for
readability.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, durham
Reviewed By: #fbhgext, durham
Differential Revision: https://phab.mercurial-scm.org/D685
5d45a997d11 in upstream changed rebase to use unfiltered repositories, which
changes the definition of tip in these two tests. Let's update the test output.
Summary:
Previously, we didn't pass through additional parameters, which resulted in
errors complaining about insufficient arguments.
Test Plan: Added a new test that previously crashed
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D689
Summary:
Now uniondatapackstore can also hold python data stores. PythonDataStore
wrapper simply passes function calls to underlying python objects and marshals
the output.
Test Plan:
* Added test case
* Tested on fbsource with treemanifest.usecunionstore=True
Reviewers: durham, simonfar, ryanmce, #fbhgext
Reviewed By: durham, simonfar, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D631
Summary: In mercurial core, the config for disabling copytrace was changed from
disablecopytrace (boolean) to copytrace which can be on or off. As a result of
this change, there were some breaks which need to be modified to work with the
new config. This commit acheives the same.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D662
Summary: cmdutil.amend was changed recently to get rid of the redundant commit
during the amend operation. As a result, we need to update this test as it was
aware of the redundant commit. This commit achieves the same.
Test Plan: Executed the test after the changes.
Reviewers: #fbhgext, durham, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D661
message empty to abort commit. HG: -- HG: user: Saurabh Singh <singhsrb@fb.com>
Summary: The dirsync extension was relying on the redundant commit in amend to
achieve the mirroring. Now with that commit removed, I decided to wrap the
cmdutil.amend itself so that we can still do the mirroring correctly during the
amend.
I added a new test file test-dirsync-amend.t to test the wrapper over amend.
The test-dirsync.t was an existing test that was broken after the amend
behavior change and has been added again with some changes. It would be best to
review it against its old version.
Test Plan: Ran the test suite.
Summary: I just had to ensure that the we were storing the amend information by
checking against the working copy instead of the intermediate commit.
The test-copytrace-amend.t wasn't added in this revision. It is actually an
existing test which was broken after the change in amend behavior. I have added
the test again with minor changes. I think it would be best to diff the test
against its old version for the review.
Test Plan: Ran the test suite.
Summary:
cmdutil.amend was changed recently to get rid of the redundant commit during
the amend operation. As a result, we need to update the tests which were aware
of the redundant commit. This commit achieves the same.
Note that as a result of the amend behavior change, the dirsync and copytrace
extensions were broken. They will be be fixed in subsequent commits on top of
this commit. For now, the broken tests for these extensions were removed from
the commit. Eventually, I will fold all the fixes together so that revision
history of the tests is not messed up. This is primarily done only to aid the
review.
Test Plan: Ran the test suite after updating the tests.
Summary:
We are adding an option --base to define a starting point for a
new branch. We define --bookmark as the head of the branch (we
might introduce a --dest option in addition). This allows us to create
new branches for release branches and others.
Note that for some reason, `arc unit` is generating different test
results than running the run-test.py manually, causing branch updates in
different situations. Therefore we have to glob a bunch of tests.
Test Plan:
python ../../hg-crew/tests/run-tests.py test-p4fastimport-* test-check*
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5769328
Signature: 5769328:1504763221:78eb81f32ec46fc56619d77537c2b1944e938466
Summary:
Extended DeltaChain with CDeltaChain and PyDeltaChain which are wrappers around
c and python delta chains respectively. The declaration and implementation
of c and python delta chains as well as DeltaChainLink were put in a different
file.
Test Plan: * Ensure that unit tests pass
Reviewers: ryanmce, durham, simonfar, #fbhgext
Reviewed By: ryanmce, durham, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D630
These lines were added in D485 but the diff indicates they weren't sure why
these lines were needed. D608 fixes the upstream bug that caused this, so now
the lines aren't necessary.
Summary:
PythonKeyIterator has been moved to a separate file, because we will need to
include it in several places in future commits.
Test Plan: * Ensure unit tests pass
Reviewers: ryanmce, durham, simonfar, #fbhgext
Reviewed By: ryanmce, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D629
Summary:
BSD echo doesn't support -e. The lint rule says to use Python instead,
so follow its advice
Test Plan: Ran tests locally on Mac and Linux.
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D619
Summary: Prevents downloading any manifest revlogs when the client is in treeonly mode.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D575
Summary:
This adds a test that pushes a treeonly commit from a treeonly client to a
hybrid server, and verifies the result is written to the server flat and tree
manifests. Also tests that hooks can access the tree data.
This also changes the server to read the treemanifest if a tree was provided in
the bundle. Previously the server would only read trees if the forcereceivetrees
flag was on, which meant we couldn't accept flat and trees at the same time,
which made migrating harder.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D571
Summary:
An orig file was getting added to a commit in a test accidentally, which makes
it harder to test the contents of that commit in a future diff. Let's purge that
file before we make the commit. This affects some of the later output because
the hash changes.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Differential Revision: https://phab.mercurial-scm.org/D570
Summary:
If the treemanifest is loaded, but not enabled for a repo, it was still
executing tree code for that repo, which would break. This adds checks to
prevent tree code from running in non-tree repositories.
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Subscribers: simonfar
Differential Revision: https://phab.mercurial-scm.org/D568
Summary:
We changed the format a little while back, but neglected to
adjust this script.
Test Plan: run it locally and saw the correct hash. Revised test case.
Reviewers: simpkins, akushner, mbolin
Reviewed By: mbolin
Subscribers: medson, mjpieters, net-systems-diffs@fb.com, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5738750
Tasks: T21489553
Signature: 5738750:1504122070:43595555652c35e721ff4248a83d615fdc330e6e
Summary:
Implementation of uniondatapackstore that can hold generic stores.
This diff doesn't support python data stores yet, but provides an abstraction
to the stores that can be used by uniondatapackstore.
DeltaChain and DeltaChainLink wrappers will allow to use C and python chains
and chain links.
Test Plan:
* Ensure that unit tests pass
* Test on fbsource to ensure new code is executed by printfing to stdout
* Ensure the code is built successfully on macOS
Reviewers: durham, ryanmce, simonfar, #fbhgext
Reviewed By: durham, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D560
Adds a test for rebasing in tree only mode and fixes a bug in readdelta where it
was returning the parent's file nodes instead of the current file nodes. The
test covers this case.
In order to support pulling from the main server, we need to:
- ignore the flat manifest part of the changegroup
- change our treeonlymanifestlog to do store.get() instead of
store.getmissing(), since only get() fetches from the remote server.
Summary: on merge during rebase, check to see if source and destination are both draft commits. If so, use full copytrace to support more functionality.
Test Plan:
In tests/test-copytrace.t, added two tests:
- Change a file name and move containing directory in one branch. Modify contents of original file name in other branch. Rebase modded file into new file name in new directory.
- Move directory in one merge parent. Add new file to original directory in other merge parent. File moved to new directory on rebase.
Reviewers: stash, #fbhgext
Reviewed By: stash, #fbhgext
Subscribers: pulkit, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D481
Summary:
Update the copyright headers in most of the C/C++ code consistently use the
GPLv2 copyright message. This allows these files to pass Facebook's internal
C/C++ linters.
Some of the files in fbcode/scm/hgext/cstore/ appear to have actually been
copied from the hg-crew repository, and were not originally authored by
Facebook. I have not modified the copyright statements in these files:
- cstore/bitmanipulation.h
- cstore/compat.h
- cstore/mpatch.h
- cstore/mpatch.c
I also have not modified any of the cfastmanifest code.
This corresponds to Facebook diff D5588677.
Test Plan:
Confirmed that Facebook's C++ linters no longer complain about the copyright
messages.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D507
Summary:
Define the ManifestPtr class in its own header file, to eliminate some of the
nasty circular dependencies between manifest.h, manifest_entry.h, and
manifest_fetcher.h
This makes the include process for these files much simpler, and prevents
manifest.h and manifest_entry.h from both trying to include each other at
different locations in their files.
This corresponds to Facebook diff D5588672.
Test Plan: Confirmed "make local" succeeds and the unit tests pass.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D506
Summary:
Keepset computation algorithm added tuples to the keepset that are the results
of diffs between two manifests. Now it has been fixed and only new node from
the tuple is added to the keepset.
Test Plan:
* Run hg gc on www, fbsource
* Ensure the unit tests pass
Reviewers: simonfar, durham, #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D519
Which packs get cleaned up is non-deterministic in some cases, so grepping for
the 'x' in this test did not catch when a non-x pack was left behind, which
caused flakey output. Let's instead check that 3 packs were left behind and one
of them was from the small generation.
Summary:
Pull --rebase when you have local draft commits moves your commits,
your working copy, and your active bookmark to the new branch head
(or whatever destination you specify with -d). If you don't have
any local draft commits, it doesn't do any of that.
This change makes it so that it does everything except moving the
commits.
Test Plan: Added new unit tests. Re-ran existing ones.
Reviewers: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D518
If a bunch of packs are the same size, the ones repack chooses to pack is
non-deterministic. This was causing flakiness in the test as different packs
were being left behind. Let's remove that dependency.
Summary:
We have an internal linter that keeps yelling at me about this spelling error.
I created this by running:
```
hg grep -l 'commited' | xargs sed -i -e 's#Changes commited as#Changes committed as#g'
```
Test Plan: CI
Reviewers: durham, quark
Reviewed By: quark
Subscribers: medson, mjpieters, stash, jeroenv
Differential Revision: https://phabricator.intern.facebook.com/D5699238
Signature: t1:5699238:1503596778:de5e4f26daeaf3649c6c09ded6bd2b459b0e5f97
In interactive mode, disables out of bounds <-,-> notifying the user with text
and a '\a' sound. Friendlier ui messages for when the user selects the current
state with the arrow keys or when trying to undo to a state before we recorded
anything. Hg serve commands generally aren't user executed and simply should be
skipped across when undoing (like unfinished states). The user can always use
--absolute to see them in preview and to undo to them.
Differential Revision: https://phab.mercurial-scm.org/D502
Summary:
Previously incremental repack would only take the top 3 packs in a generation of
packs. For instance, if there were 100 packs between 1KB and 1MB, it would only
repack the first 3, instead of repacking a whole bunch because it's cheap. This
patch fixes it to grab as many packs in a generation as it can fit under the
limit (default of 100MB of pack data).
This will fix an issue where we're seeing users with 100's of tiny pack files
that aren't getting repacked fast enough.
Test Plan: Added a test
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Subscribers: quark
Differential Revision: https://phab.mercurial-scm.org/D500
Summary:
tweakdefaults already overrides amend, rebase and graft to update the commit date
to the current time when it creates new commits.
This extends this to also give the same behavior to histedit.
Test Plan: New unit test added.
Reviewers: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D490
It seems `debugcheckbackup` could get a new kind of error with the latest
upstream code:
Traceback (most recent call last):
File "hg/mercurial/scmutil.py", line 150, in callcatch
return func()
File "hg/mercurial/dispatch.py", line 292, in _runcatchfunc
return _dispatch(req)
File "hg/mercurial/dispatch.py", line 896, in _dispatch
cmdpats, cmdoptions)
File "hg/mercurial/dispatch.py", line 658, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "hg/mercurial/dispatch.py", line 904, in _runcommand
return cmdfunc()
File "hg/mercurial/dispatch.py", line 893, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "hg/mercurial/extensions.py", line 322, in closure
return func(*(args + a), **kw)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "hg/hgext/mq.py", line 3542, in mqcommand
return orig(ui, repo, *args, **kwargs)
File "hg/mercurial/util.py", line 1118, in check
return func(*args, **kwargs)
File "fb-hgext/infinitepush/backupcommands.py", line 272, in checkbackup
if not _dobackupcheck(bkpstate, ui, repo, dest, **opts):
File "fb-hgext/infinitepush/backupcommands.py", line 469, in _dobackupcheck
for r in lookupresults:
File "hg/mercurial/wireproto.py", line 137, in results
next(batchable)
File "hg/mercurial/wireproto.py", line 238, in lookup
self._abort(error.RepoError(data))
File "hg/mercurial/sshpeer.py", line 235, in _abort
raise exception
RepoError: 0e1a088ff2825213eaa838a82a842bc186f10dd5
abort: 0e1a088ff2825213eaa838a82a842bc186f10dd5!
The error message only contains a commit hash, which is not friendly to be
printed out. Therefore make sure we have control about the error message and
update the test accordingly.
Differential Revision: https://phab.mercurial-scm.org/D485
The --pushvars option to push is moved to core with an extra config named
push.pushvars.server which defualts to False. This config controls whether the
server to unbundle the variables send by pushvars.
To make sure nothing breaks for those with pushvars extension enabled,
this should be added to the configuration file:
[push]
pushvars.server = True
Differential Revision: https://phab.mercurial-scm.org/D365
Summary:
Add a clib/sha1.h file with SHA-1 utility functions that hide the details of
the underlying SHA-1 implementation being used. This will make it easier in
the future if we want to use the faster SHA-1 implementation from OpenSSL if it
is available, but fall back to the sha1collisiondetection library if it is not
available.
Test Plan: Confirmed the code builds and passes unit tests.
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D282
Summary:
Move the third-party sha1collisiondetection code from clib/sha1 to
third-party/sha1dc. This helps isolate third-party code from our own
internally developed code.
This also updates the code to use the same include paths and library names as
used by the sha1collisiondetection's upstream Makefile, which would be needed
to link against a version of sha1collisiondetection installed locally.
Test Plan:
Confirmed "make local" succeeds.
All of the tests pass, except for test-check-commit-hg, which complains about
the fact that some of this third-party code contains multiple empty lines in a
row. It doesn't seem straightforward to update test-check-commit to ignore
this third-party code, but these test failures shouldn't affect any future
commits.
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Differential Revision: https://phab.mercurial-scm.org/D281
Summary: Object lookup fails in blobstore provided vague error message when a specific file was not present. Updating error message to reference the filename associated with the blob not found.
Test Plan:
In facebook-hg-rpms/fb-hgext/tests directory: rt test-lfs-test-server.t
Shows no error and validates that correct error message is displayed
Reviewers: quark, rainee, davidsp
Reviewed By: davidsp
Subscribers: medson, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D5617283
Tasks: T18972111
Signature: t1:5617283:1503070630:56fdcab5295ce7d050a24f1a989806066ef7054f
Change preview to just show the delta and connected commits. This means we need
to calculate oldworkingcopyparent and bookmarks diffs. This output will be
cleaner especially for people with a lot of commits in their repo.
Differential Revision: https://phab.mercurial-scm.org/D467
Summary:
--list-remote can return too many nodes if used without a pattern.
Let's require a pattern.
Test Plan: Run unittests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D221
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