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:
Upstream mercurial commit c20590e65d36 changed revlog.versionformat from a
string to a struct.Struct object. The upgradegeneraldelta extension needs to
be updated to deal with this.
Test Plan:
Confirmed existing tests pass, and manually tested using pull with
upgradegeneraldelta enabled. I believe this extension shouldn't really be in
use in any repositories any more, but somehow some users did run into this.
Reviewers: #fbhgext, sid0
Reviewed By: #fbhgext, sid0
Differential Revision: https://phab.mercurial-scm.org/D162
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:
We've seen problems when public nodes were pushed to the server.
While the real reason is unknown it's a good idea to add a safety net to prevent
sending too many commits to the server because it's usually means that we are
pushing public commits. We limit number of nodes to 1000
Test Plan: Run infinitepush tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D143
Summary:
We've had problems when users sent huge bundles to the server.
Let's limit the size of the bundle.
Test Plan: Run infinitepush tests
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D142
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
Before, out of syncness of in memory state and on disc state caused certain
commands to (appear to) perform repo changes after they had returned. This
broke hg undo. This change fixes this by using the in memory state.
Differential Revision: https://phab.mercurial-scm.org/D150
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:
Refactor the showsyncstatus function to clean up the code a little bit.
- Don't bother to call populateresponseforphab() if the current commit does not
contain a differential revision ID.
- Only call getdiffstatus() once instead of 4 times. getdiffstatus() does
cache the result instead of hitting phabricator each time, but it is still
better to just re-use the return value ourselves instead of hitting the
memoization code.
- Refactor the error handling to avoid having deeply nested conditional blocks.
Test Plan: Confirmed existing tests still pass, and manually tested using the template.
Reviewers: #fbhgext, ryanmce
Reviewed By: #fbhgext, ryanmce
Subscribers: ryanmce
Differential Revision: https://phab.mercurial-scm.org/D79
If a test enables extension X, then changes to extension X should trigger
that test to run.
This avoids issues like D123 not updating all tests that need change.
Test Plan:
Make a test commit touching `fbamend/__init__.py`, and run `unit.py`:
37 tests to run: test-smartlog-tweakdefaults.t test-fbamend-metaedit.t test-fbamend-split.t test-check-execute-hg.t test-check-shbang-hg.t test-fbamend-restack.t test-sqldirstate-fbhistedit.t test-fbamend-previous.t test-fbhistedit-stop.t test-fbamend-next.t test-tweakdefaults.t test-copytrace-amend.t test-fastpartialmatch-obsolete.t test-fbamend-nextrebase.t test-fbamend-hiddenoverride.t test-fbamend-fold.t test-check-config-hg.t test-fbhistedit-exec.t test-smartlog-obsolete.t test-infinitepush-bundlestore.t test-fbamend-rebase.t test-fbamend-to.t test-reset.t test-infinitepush-pullback-obsolete.t test-tweakdefaults-opawarecommands.t test-fbamend-userestack.t test-fbamend-noinhibit.t test-smartlog-inhibit.t test-check-commit-hg.t test-cleanobsstore.t test-infinitepush-backup.t test-check-code-hg.t test-check-pyflakes-hg.t test-fbamend.t test-pull-createmarkers.t test-pull-createmarkers-hide-later.t test-tweakdefaults-bookmarks.t
Note `test-smartlog-tweakdefaults.t` does not have `fbamend` in its filename
and is also triggered.
Differential Revision: https://phab.mercurial-scm.org/D148
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: This broke the tests.
Test Plan: test-check-code-hg.t passes on this file again
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Subscribers: simonfar
Differential Revision: https://phab.mercurial-scm.org/D144
Summary:
git-sl is a script to emulate some of hg smartlog, but for git. It's generally
useful, and demonstrates some of our thinking around source control, so let's
release it to the world.
Test Plan: Just for documentation
Reviewers: durham
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D5433956
Tasks: 20166062
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: This broke the check-code linter.
Test Plan: run linters and unit tests
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D137
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
Summary:
Without this, we get develwarnings about vfs being deprecated for accessing
files under .hg/cache/.
Test Plan: run-tests, more tests pass
Reviewers: #fbhgext, mitrandir
Reviewed By: #fbhgext, mitrandir
Differential Revision: https://phab.mercurial-scm.org/D129
Summary:
This is a first set of changes to help `cdatapack` compile on Windows. Second
set will include adding some way of using `mman` on Windows.
Test Plan:
- `make local` on Linux, `rt`
- with some intermediary solution for `mman` this also builds on Windows 10,
I was able to produce `cdatapack_get.exe` and `cdatapack_dump.exe`. Here's an
example:
```
PS C:\Code\fb-hg-rpms\fb-hgext\cdatapack> .\cdatapack_get.exe 3ba0b10b8d251743a2692e042b114c1204b19d74 88dadb363234ec4fec3df85810810d6073288350
xplat/third-party/yarn/offline-mirror/smoothscroll-polyfill-0.3.5.tgz
Node Delta Base Delta SHA1 Delta Length
88dadb363234ec4fec3df85810810d6073288350 0000000000000000000000000000000000000000 466e6039b51cb525d70e1a5077ef81e064678eae 26057
```
Reviewers: durham, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D106
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
This is the result of running a codemod script:
python ~/hg/contrib/codemod/codemod_nestedwith.py **/*.py
Plus a manual cleanup that removes the comment in `absorb/__init.py`.
See D76 for the codemod script.
Differential Revision: https://phab.mercurial-scm.org/D78
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:
Upstream has changed the signature of saveback to include the full name. Let's
update to match it.
Test Plan: The test now passes
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Differential Revision: https://phab.mercurial-scm.org/D105
Summary:
Upstream has added warnings when writing files outside the wlock, so let's put
this write in the wlock.
Test Plan: The tests now pass
Reviewers: #fbhgext, stash
Reviewed By: #fbhgext, stash
Subscribers: stash, simonfar
Differential Revision: https://phab.mercurial-scm.org/D104
Summary:
Upstream has added devel-warnings when writing to vfs files without taking the
wlock. We need to take the wlock here.
Test Plan: The test now passes
Reviewers: #fbhgext, simonfar
Reviewed By: #fbhgext, simonfar
Subscribers: simonfar
Differential Revision: https://phab.mercurial-scm.org/D103