Commit Graph

605 Commits

Author SHA1 Message Date
Saurabh Singh
a995eb2fd1 amend: removing redundant commitfunc parameter in amend wrappers
Summary: cmdutil.amend was recently changed and the commitfunc parameter was
removed. This commit fixes the wrappers on the amend function by removing the
redundant parameter.

Test Plan: Ran the existing test suite
2017-09-08 10:07:41 -07:00
Saurabh Singh
a6ec1d2188 dirsync: fixing mirroring following removal of redundant commit in amend
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.
2017-09-08 10:01:05 -07:00
Saurabh Singh
7daa1a0dda copytrace: fixing amend wrapper following removal of redundant commit in amend
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.
2017-09-08 10:00:09 -07:00
David Soria Parra
9787efd179 p4fastimport: add --base option to define branchpoint
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
2017-09-07 19:44:16 -07:00
Phil Cohen
e3d9d9e6d3 drop: update -r description from 'revs' to 'rev'
Differential Revision: https://phab.mercurial-scm.org/D658
2017-09-07 12:47:43 -07:00
Andres Suarez
6a6c71a9f2 tweakdefaults: support -I and -X in grep
Summary:
Pass-through the common `-I`/`--include` and `-X`/`--exclude` flags to
`scmutil.match`. This gives `hg grep` similar semantics to other commands that
support filtering by pattern.

Test Plan:
```
$ hg grep backgroundprefetch
remotefilelog/__init__.py:    ``remotefilelog.backgroundprefetch`` runs prefetch in background when True
remotefilelog/__init__.py:            repo.backgroundprefetch(bgprefetchrevs, repack=bgrepack)
remotefilelog/__init__.py:                                        'backgroundprefetch', False)
remotefilelog/__init__.py:                repo.backgroundprefetch(prefetchrevset, repack=bgrepack)
remotefilelog/shallowrepo.py:        def backgroundprefetch(self, revs, base=None, repack=False, pats=None,
tests/test-remotefilelog-bgprefetch.t:  > backgroundprefetch=True

$ hg grep -X '**/*.py' backgroundprefetch
tests/test-remotefilelog-bgprefetch.t:  > backgroundprefetch=True
```

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5764306

Signature: 5764306:1504535581:ebc8d9f76bbd243d49b1b3306620b88a4f16e818
2017-09-04 15:45:37 +01:00
Durham Goode
11030d633e ui: update calls to edit() to match upstream
Upstream has added devel warnings around edit, so we need to update our usage.
In particular, the action parameter is now required, and the suffix extra will
soon be ignored.
2017-09-01 15:53:54 -07:00
Durham Goode
a1cda97877 perftweaks: fix rebase size tracking
Summary: Upstream change the rebase signature, so let's change our wrapper.

Test Plan: Ran the tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D585
2017-08-31 13:28:52 -07:00
Durham Goode
1893cf283c tweakdefaults: remove order from analyze function
Summary: This broke working with upstream hg.

Test Plan: Ran the tests

Reviewers: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D584
2017-08-31 11:29:02 -07:00
Durham Goode
0faa105a6d tree: adds test for pushing a treeonly manifest to a hybrid server
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
2017-08-31 11:14:39 -07:00
Durham Goode
2d3cc1e08b rage: fix lint 2017-08-31 11:11:59 -07:00
Kostia Balytskyi
dce0c8c3ab gitrevset: add a missing import keyword
Summary: Add a missing import statement.

Test Plan: - meh.

Reviewers: #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D580
2017-08-31 08:27:03 -07:00
Jun Wu
30dd85108c rage: replace print with ui.write
Content written by `print` may not get flushed (especially in chg's case).
Use `ui.write` so Mercurial is responsible for flushing `ui.fout`.

Differential Revision: https://phab.mercurial-scm.org/D572
2017-08-30 14:05:55 -07:00
Jun Wu
d22b57e262 revset: accept additional arguments for stringset
D451 is going to add an `order` parameter so let's update our code.

Also remove the wrapping of `revset.symbols['stringset']`, which is no
longer needed by the current Mercurial.

Differential Revision: https://phab.mercurial-scm.org/D543
2017-08-30 13:17:20 -07:00
Dylan Richardson
5b84495e9e copytrace: use full version of copytrace for draft branch rebases
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
2017-08-29 08:57:54 -07:00
Mark Thomas
6455de7566 tweakdefaults: make pull --rebase ffwd if nothing to rebase
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
2017-08-25 09:01:41 -07:00
Michael Bolin
9578f20605 spelling: change commited -> committed
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
2017-08-24 14:13:58 -07:00
Felix Merk
c2634fb76a undo: work better with chg
chg runs a mercurial command, we want to see which actual commands are run and
don't want to wrap at the chg level.

Differential Revision: https://phab.mercurial-scm.org/D504
2017-08-24 13:17:02 -07:00
Felix Merk
ec97c2cb17 interactiveui: disable line wrapping
Disables line wrapping for interactive ui. This makes sure the line count is
correct and the output is clear.

Differential Revision: https://phab.mercurial-scm.org/D503
2017-08-24 12:59:28 -07:00
Felix Merk
48ec146530 undo: better error messaging and hiding hg serve commands
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
2017-08-24 12:29:40 -07:00
Jun Wu
2a0ec5edb8 inhibitold: remove the extension
It was kept there to allow us to fallback to it in emergency cases. But the
new hiddenoverride code seems to work well. Therefore remove the old inhibit
extension.

Differential Revision: https://phab.mercurial-scm.org/D501
2017-08-24 10:41:52 -07:00
Mark Thomas
986a478c59 tweakdefaults: make histedit update dates of commits it edits
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
2017-08-24 07:45:02 -07:00
Jun Wu
0dcbdce81e undo: explicitly disable pager on viewframe
`cmdutil.graphlog` may start pager. Explicitly disable it during
`viewframe.__init__` so the output won't get messed up.
2017-08-24 01:17:41 -07:00
Jun Wu
a2c1b1b707 undo: abort earlier if -i is specified
Check unfinished state and dirty working copy first so people won't get an
abort after selecting a state in the interactive interface.
2017-08-24 01:17:41 -07:00
Jun Wu
6363c9a947 undo: import interactiveui directly
This allows `undo -i` to always work.
2017-08-24 01:17:41 -07:00
Felix Merk
f9fd057193 undo: include ancestor in preview 2017-08-23 18:50:25 -07:00
Jun Wu
d035699241 compat: add empty placeholder extensions
We still have config that enables bundle2hooks and commitextras extensions.
Keep them in the repo so users won't get warnings.
2017-08-23 14:33:56 -07:00
Jun Wu
26e7f4a998 split: only do checkunfinished if rebase is needed
It's a valid use-case to run split inside a histedit plan. The
checkunfinished was added by D161, which was caused by a user report that
the split changes got lost because of rebase failure. If there is no need to
rebase, then checkunfinished is not necessary.

In the future we might want a `splitstate` to make it harder to lose split
commits.

Differential Revision: https://phab.mercurial-scm.org/D488
2017-08-23 08:47:31 -07:00
Pulkit Goyal
9c86deebae pushvars: cleanup the extension to just set the server config option
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
2017-08-23 09:28:07 +05:30
Pulkit Goyal
c288e6c436 bundle2hooks: remove the extension from hgext3rd as it is moved to core
The ability to add hookargs to a bundleoperation object has been added to the
core from this extension.

Related commits are:
https://www.mercurial-scm.org/repo/hg-committed/rev/bf6a06e6310e
https://www.mercurial-scm.org/repo/hg-committed/rev/aa97e972460f

Differential Revision: https://phab.mercurial-scm.org/D364
2017-08-23 09:28:07 +05:30
Pulkit Goyal
2930e709e9 commitextras: remove the extension from hgext3rd as it is moved to core
This extension is moved to core as an extension in
https://www.mercurial-scm.org/repo/hg/rev/bb5f26e8d735.

This patch also removes the test of the extension.

Differential Revision: https://phab.mercurial-scm.org/D363
2017-08-23 09:28:07 +05:30
Jun Wu
6f6c83a6af pyflakes: fix peermod unused error
When rewriting D425 to use `iterbatch()`, I forgot to remove the unused
import. This patch removes them.
2017-08-22 20:42:52 -07:00
Sonia Kim
7ef1e18d89 lfs: include filename in object lookup fail message
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
2017-08-22 10:54:41 -07:00
Felix Merk
9df57fe0d2 undo: preview change - just show delta
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
2017-08-22 10:18:03 -07:00
Stanislau Hlebik
e3d7418df4 fastlog: use ui.log() instead of ui.warn()
Summary:
ui.warn() just prints to the stderr. It has two disadvantages:
1) Distracts a user
2) Doesn't notify us about the problem.

Let's use ui.log() that will send result to our logging system

Test Plan: Run unit-tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D443
2017-08-22 01:23:25 -07:00
Felix Merk
66fc95aa46 interactivui: get rid of flashing
Prevent flashing in 'hg undo -i' for smoother ux.  Tested by running hg undo -i
and not seeing flashes when hitting left or right.

Differential Revision: https://phab.mercurial-scm.org/D465
2017-08-21 15:55:16 -07:00
Jun Wu
805ddc8422 codemod: be compatible with upstream change
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
2017-08-21 15:10:41 -07:00
Felix Merk
fcd302bf7b undo: draft obsolete commits
Visible obsolete commits are slightly tricky.  For example, an amend in the
middle of a stack will leave behind a visible obsoleted commit.  This diff
removes visible obsolete commits from 'olddraft()'.  This removes the need for
some special casing and allows for a more powerful preview.

Differential Revision: https://phab.mercurial-scm.org/D463
2017-08-21 13:28:50 -07:00
Felix Merk
cfbbbdf2c6 undo: preview perf improvements
Based on Adam Simpkin's ideas, faster code for the template functions.

Differential Revision: https://phab.mercurial-scm.org/D462
2017-08-21 13:28:50 -07:00
Felix Merk
e45f912211 undo: preview shows command and time output
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
2017-08-21 11:25:36 -07:00
Felix Merk
721459469f undo: draft obsolete handling
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
2017-08-18 11:40:18 -07:00
Felix Merk
2d555e35dd undo: informative output
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
2017-08-18 11:37:45 -07:00
Felix Merk
aa2547d949 undo: unfinished command handling
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
2017-08-18 11:37:45 -07:00
Ryan McElroy
674d828aad undo: allprecursors -> allpredecessors
Summary: Per upstream name changes. Eliminated develwarns.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D432
2017-08-18 03:11:29 -07:00
Ryan McElroy
28eed8e961 phabstatus: allprecursors -> allpredecessors
Summary: Renamed upstream. Eliminate more develwarns.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Subscribers: simonfar

Differential Revision: https://phab.mercurial-scm.org/D431
2017-08-18 03:11:29 -07:00
Ryan McElroy
42c167e16e fbamend: allprecursors -> allpredecessors
Summary: Renamed upstream. Prevent develwarns.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D430
2017-08-18 03:11:29 -07:00
Ryan McElroy
6ce9175cd1 fbamend: precursor -> predecessor
Summary: Get in line with upstream name change and eliminate develwarns.

Reviewers: #fbhgext, simonfar, simpkins

Reviewed By: #fbhgext, simonfar, simpkins

Subscribers: quark, simpkins, simonfar

Differential Revision: https://phab.mercurial-scm.org/D429
2017-08-18 03:11:29 -07:00
Ryan McElroy
e2dfc69dc2 fbamend: precnode -> prednode
Summary:
Upstream is changing names to be more consistent. Follow suit to eliminate
devel-warnings.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Subscribers: simonfar

Differential Revision: https://phab.mercurial-scm.org/D428
2017-08-18 03:11:29 -07:00
Ryan McElroy
7770cdf605 undo: precnode -> prednode
Summary: Names be a'changin.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D427
2017-08-18 03:11:29 -07:00
Felix Merk
3f41f783a1 undo: performance improvement attempt
Undo -p is really slow on certain large repos.  This caches 'olddraft()' by
using the revlog nodes.  Since revlogs are immutable this should be really safe
and could hopefully dramatically improve not only hg undo -p performance, but
performance of all undo commands.

Differential Revision: https://phab.mercurial-scm.org/D439
2017-08-17 16:45:37 -07:00