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
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