Commit Graph

807 Commits

Author SHA1 Message Date
Durham Goode
f7249fd2e2 treemanifest: implement treemanifest.__nonzero__
This implements the __nonzero__ function, which is necessary for things like
`if mymanifest:`
2016-10-14 16:01:12 -07:00
Durham Goode
ae6de9bbdb treemanifest: implement treemanifest.dirs()
This implements the dirs function, which returns a collection set that can
answer the question of if a directory is in the manifest. Currently we do a
naive solution of using util.dirs(), which iterates over all the files. Given
that we have a tree already, we should be able to return something smarter in
the future.
2016-10-14 16:01:12 -07:00
Durham Goode
c171077ebd treemanifest: add None check for treemanifest.contains()
Mercurial sometimes checks if "None in mf", so we need to make sure we return
False in that situation.
2016-10-14 16:01:12 -07:00
Durham Goode
75c7cb42a1 treemanifest: implement hasdir()
Implements the py-treemanifest.hasdir() function
2016-10-14 16:01:12 -07:00
Durham Goode
445c6b0d4e treemanifest: fix diff on transient trees
The diff algorithm assumed every tree already had a node. If we are iterating
over an uncommitted tree, it may have tree entries with NULL as their node. We
need to always recurse in these cases.
2016-10-14 16:01:12 -07:00
Durham Goode
cd423fd42a treemanifest: implement 'clean' on diff
hg has an optional 'clean' arg on diff, which causes it to also return files
that aren't different between the two diffs. This implements it on our
treemanifest diff algorithm.
2016-10-14 16:01:12 -07:00
Durham Goode
7f2988ce25 treemanifest: implements text()
Implements the py-treemanifest.text() function
2016-10-14 16:01:12 -07:00
Durham Goode
f108eebde4 treemanifest: implements __setitem__
Implements the py-treemanifest.__setitem__ function. This also handles the
__delitem__ case.
2016-10-14 16:01:12 -07:00
Durham Goode
d96c188d00 treemanifest: implement setflag()
Implements the py-treemanifest.setflag() function
2016-10-14 16:01:12 -07:00
Durham Goode
ea9c99a376 treemanifest: implement get()
Implements the py-treemanifest.get() function
2016-10-14 16:01:12 -07:00
Durham Goode
8600c8a313 treemanifest: fix test python path
__file__ is not always an absolute path, so we need to perform a join in some
situations.
2016-10-14 16:01:12 -07:00
Arun Kulshreshtha
37cf7bd354 Make hg rebase --restack smarter
Differential Revision: https://phabricator.intern.facebook.com/D4000348
2016-10-14 11:05:53 -07:00
Stanislau Hlebik
8bdaa46014 infinitepush: set scratch bookmark locally during push
Summary:
Previously `--to` bookmark was not set locally.
This diff fixes it by setting this bookmark to the head after push happened.
This is correct because it's guaranteed that we'll push only one head.

Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: durham, rmcelroy, mitrandir

Subscribers: mjpieters

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

Tasks: 12479677
2016-10-13 00:11:56 -07:00
Jun Wu
82b158ed59 githelp: fix crash in mergebase
Summary: `_` does not take two arguments while `ui.status` does.

Test Plan: Added a test case

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: mjpieters

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

Signature: t1:4010079:1476298648:81e678fbe433aa8cca8b03c9eba50d9b78bbc9bb

Blame Revision: D2811887
2016-10-12 19:47:42 +01:00
Stanislau Hlebik
a4b6a2a1bb infinitepush: better error message
Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: rmcelroy, mitrandir, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:4001218:1476227692:c60b3def4e82911a40fe577bc44cf7d24cba9438
2016-10-12 02:57:53 -07:00
Arun Kulshreshtha
a154bbaeb0 Add hg rebase --restack
Summary:
This change adds a `--restack` option to `hg rebase`. When invoked, the command will rebase all descendants of precursors of the current changeset onto the current changeset. This is similar to the behavior of `hg evolve --all`, except it only handles unstable changesets, and not other issues that can arise from shared mutable history such as divergence or bumping.

I've been playing around with some of the more advanced features (such as allowing the command to be run from anywhere in the old stack or new stack, as well as allowing the user to specify the number of changesets to rebase), but I wanted to upload the most simple iteration of this command for feedback.

Test Plan:
See unit tests for complete commands.

1. Create a stack of commits.
2. Somewhere in the middle of the stack, amend a commit, potentially several times.
3. Run `hg rebase --restack`.
4. The top half of the stack should be rebased onto the amended commit, and the preamend bookmark should be gone.

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: rmcelroy, quark, mjpieters

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

Tasks: 13651947

Signature: t1:3972103:1476230834:8f77eac4e8d8681dd9f8125747c1ff75c8da1ad8
2016-10-11 17:41:07 -07:00
Kostia Balytskyi
6cd744ec1a tests_: adjust test-mergedriver.t tests according to the core changes
Differential Revision: https://phabricator.intern.facebook.com/D4001645
2016-10-11 07:42:20 -07:00
Stanislau Hlebik
f1e2014203 infinitepush: add option to force non-fast-forward push
Summary:
Non-fast-forward pushes were disallowed. But having a
mutable shared history for scratch branches is a very
nice feature. Let's use --force option to force
non-fast forward push.

Test Plan: Run test-infinitepush-bundlestore.t

Reviewers: durham, rmcelroy, mitrandir

Subscribers: mjpieters

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

Tasks: 12479677
2016-10-10 03:48:21 -07:00
Stanislau Hlebik
4731550d0f infinitepush: output bookmark hash in tests
Summary:
Simple test improvement: output scratch bookmark name
together with scratch bookmark hash

Test Plan: Run test-infinitepush-bundlestore.t

Reviewers: durham, rmcelroy, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3994805:1476112139:a02c78dd8a117f99251e71827224bb368532052b
2016-10-10 08:37:04 -07:00
Jun Wu
de2e6fd858 fastannotate: add diffopts
Summary:
The vanilla annotate command takes diffopts, let's add it to fastannotate.
This is also useful to support hgweb correctly.

Test Plan: Added a new test

Reviewers: #sourcecontrol, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters

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

Signature: t1:3992672:1475944204:2fbdf6a90d8c965775e3b7d5bc55fdb37c8909e7
2016-10-08 15:58:21 +01:00
Jun Wu
417bff83a4 fastmanifest: add the missing readfast method
Summary:
Upstream 4718718ed358 requires a `readfast` method for manifestctx.
`hybridmanifestctx` does not have such method so let's add it.

Test Plan: Added a test.

Reviewers: durham, ttung, #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:3955478:1475582074:f80c9eb97bcd42846625727ef1da4bce3256c88c
2016-10-01 01:34:50 +01:00
Kostia Balytskyi
8bf34fd038 tests_: fix tests in accordance with the core changes
Differential Revision: https://phabricator.intern.facebook.com/D3967244
2016-10-04 05:25:28 -07:00
Stanislau Hlebik
d63ba71acf infinitepush: remove defaults
Summary: I think it's better throw if misconfigured then silently proceed

Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: durham, mitrandir, quark, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3967202:1475581664:9d7b3e21fce48a49eda35bde473915cb64dfdfa0
2016-10-04 04:52:31 -07:00
Stanislau Hlebik
e42fe1fdc5 infinitepush: do not require mysql.connector to be present on client
Summary:
Previously error was thrown if mysql.connector wasn't present on client hosts.
But there is no need for mysql.connector to be installed on clients.
Remove global imports to fix it and create bundlestore() only for server repo.

P. S.
Changes in test is required because bundlestore() is not created if
infinitepush.server=True is not present in config.

Test Plan:
Uninstall mysql.connector: `sudo yum remove mysql-connector-python`
Enable infinitepush extension in any repo and run any hg command (hg st,
for example). Make sure it doesn't throw exceptions.

Install mysql.connector: `sudo yum install mysql-connector-python`.
Run `test-infinitepush-bundlestore.t`

Reviewers: durham, mitrandir, quark, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3967189:1475581802:fbaafceac298242d0a449267ec0d68e290c3f262
2016-10-04 04:52:03 -07:00
Jun Wu
8cf88a152b test-sparse: fix the test
Summary: Seems the output has changed somehow and needs an update.

Test Plan: Run the test

Reviewers: #sourcecontrol, rmcelroy, mjpieters

Reviewed By: rmcelroy

Subscribers: mitrandir, rmcelroy, mjpieters

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

Signature: t1:3955443:1475332010:d2a0e33b509d198312d71458aaf0dfd7f5ce73d7
2016-09-29 18:36:16 -07:00
Ryan McElroy
78f0c73d4b extension to print commit message that would be supplied to editor
Summary:
the nuclide team would like to be able to get the commit template
message without actually invoking a commit. This small extensions allows them
to do this.

Caveats: ignores subrepositories.

Test Plan: new test

Reviewers: #mercurial, most

Subscribers: mjpieters

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

Tasks: 12771006
2016-10-03 04:39:51 -07:00
Kostia Balytskyi
db64f55505 tests_: fixing tests in accoring to cmd option negation added by upstream
Differential Revision: https://phabricator.intern.facebook.com/D3950940
2016-10-03 02:01:18 -07:00
Stanislau Hlebik
ddd4873227 infinitepush: temp remotenames fix
Summary:
Hack to fix interaction with remotenames. Remotenames push '--to' bookmark to the server but we don't want to push scratch bookmark to the server. Let's delete '--to' and '--create' and also set allow_anon to True (because if --to is not set remotenames will think that we are pushing anonymoush head).


Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: durham, mitrandir, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3937202:1475170335:fa4d39e1e17bea67b62b99dfc4cd2ffa4e5d6bea
2016-10-02 05:13:06 -07:00
Stanislau Hlebik
387f18b269 infinitepush: fix push of scratch bookmark on existing commit
Summary:
It's possible to push new scratch bookmark which points to existing scratch
commit. Previously it has failed with a stack trace.

Unfortunately it still doesn't allow to push scratch bookmark that points
to non-scratch commit. It requires more complex changes so
it will be fixed later if necessary.

Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: rmcelroy, mitrandir, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3936728:1475078059:ac4588e086b0344070a90f806b6f518c6e187c3b
2016-10-02 03:05:50 -07:00
Stanislau Hlebik
ba3ebe099e infinitepush: fix interaction with pushrebase
Summary:
infinitepush bundle2 part should be run before pushrebase bundle2 part. This is a bit tricky since both pushrebase and infinitepush change the `extensions._order` and both of them try to load before bundle2 `changeset` part.

I suggest to load before 'changeset' or pushrebase part whichever is earlier. Then we have two situations:
1) pushrebase comes first. It sets it's part before 'changeset' part, then infinitepush sets it's part before pushrebase part.
2) infinitepush comes first. It sets part before 'changeset' and pushrebase part, then pushrebase sets it's part before 'changeset' part. Since infinitepush part comes before 'changeset' part it still be before pushrebase part.

This solution is not robust but it should be fine for now. The proper solution requires changes upstream that will introduce dependencies between bundle2 parts.

Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: rmcelroy, mitrandir, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3930697:1475079064:1b5851df4d2067ec21ec01e7510ddf83ff1684ad
2016-10-02 02:54:03 -07:00
Zach Amsden
2f33513a19 Log interactive time, internal command timing to scuba
Summary:
Use wrappers around ui functions to exclude interactive
and log the results to scuba.

Test Plan:
   USE_DIST_HG= FB_HG_DIAGS= CHGDISABLE= hg --config 'extensions.profiling=~/facebook-hg-rpms/fb-hgext/hgext3rd/profiling.py'  --pager=off --config profiling.enabled=False amend --edit
  chg: disabled by CHGDISABLE
  internal stats file: /tmp/scm-internal-statsx9EXSw
  hg profiling mode: SKIPPED
  stats: {
      "int": {
          "builddate": 1471281577,
          "cachehitratio": 75,
          "consumed": 425,
          "diffcachehitratio": -1,
          "elapsed": 1921,
          "errorcode": 0,
          "filesnotincachehitratio": -1,
          "interactive_time": 1534,
          "internal_time": 1701,
          "time": 1473459054
      },



Tested both with and without chg to make sure both modes work, otherwise
there are some subtle bugs that can come up under hg (timer becomes persistent
if invoked too early in uisetup).

Check out scuba table, new columns are showing up.  I still need to clean up the table as I accidentally added data as string first.

Reviewers: #sourcecontrol, ttung, quark, durham

Reviewed By: durham

Subscribers: giorgioc, mjpieters, akushner

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

Tasks: 12879683

Signature: t1:3844697:1475250469:a46aff22781e0e07596e2880d6477a62754f1397
2016-09-30 12:32:21 -07:00
Arun Kulshreshtha
bc3b0cd1c7 Make hg next --rebase intelligently obsolete/inhibit changesets
Summary:
This change updates the behavior hg next --rebase. Specifically:

  - Only one changeset can be rebased at a time. If there are multiple candidate changesets, the command aborts.
  - Each time a changeset is rebased, its precursor is marked as obsolete, inhibition markers are stripped from it and its ancestors, and its preamend bookmark is deleted, if one exists.
  - The result of this is that if no non-obsolete changesets depend on the existence of the pre-rebased changeset, that changeset and its ancestors will be stripped, resulting in a cleaner user experience.
  - This change also adds back the --evolve flag, but makes it show in error instead of working. It turns out that removing the flag outright breaks the evolve extension.

Test Plan:
See updated unit tests for the exact commands to run to test this, as well as an overview of all of the new situations where behavior was changed.

A basic test plan would be:
1. Initialize a new repository, and create a stack of 4 commits.
2. Amend the second commit in the stack.
3. Do `hg next --rebase`. It should work as before.
4. Do `hg next --rebase` again. This time, the entire old stack should "disappear" from hg sl.

Additionally, attempting to run `hg next --rebase` when there are multiple possible child changesets should fail.

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: quark, mjpieters

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

Tasks: 13570554

Signature: t1:3941922:1475205056:58a8d1726cfcccbf14a38727be0220a09532ec97
2016-09-30 10:40:58 -07:00
Jun Wu
1093ee0826 fastmanifest: implement readdelta for hybridmanifestctx
Summary:
This fixes a crash that `hybridmanifestctx` does not have `readdelta`
after upstream's b404425704fa. `readdelta` should be fast for vanilla
manifest so just forward the call there.

Test Plan: Modify a file that `.` touched, run `hg amend` and it won't crash.

Reviewers: ttung, #sourcecontrol, durham

Reviewed By: durham

Subscribers: mjpieters

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

Signature: t1:3948989:1475198696:d8ae194500fc093c03cc115f4613a9b8c8bfbff2
2016-09-30 02:09:43 +01:00
Jun Wu
a3335c81b5 fastannotate: add a test for perfhack
Summary:
The test is just a copy of the existing one but with perfhack enabled. It's
expected to generate the same test result.

Test Plan: Run the newly added tests

Reviewers: #sourcecontrol, stash

Reviewed By: stash

Subscribers: mjpieters

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

Signature: t1:3937109:1475166970:4c39d9b15878458cd8b4a26323749224a4c3c746
2016-09-28 13:15:41 +01:00
Jun Wu
38100f3be4 fastannotate: handle empty file correctly
Summary:
`_decorate` backported from upstream does not handle empty file correctly.
It would raise an assertion error when annotating an empty file:

  File "fastannotate/commands.py", line 138, in fastannotate
    not showdeleted))
  File "fastannotate/context.py", line 331, in annotate
    return self._refineannotateresult(result, revfctx, showpath, showlines)
  File "fastannotate/context.py", line 503, in _refineannotateresult
    if len(lines) != len(result):
  AssertionError

This patch fixes it.

Test Plan: Run the modified test.

Reviewers: #sourcecontrol, stash

Reviewed By: stash

Subscribers: mjpieters

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

Signature: t1:3944132:1475166894:e2610c6364806b77c8533315a1a0a08b6c158fe5
2016-09-29 16:48:40 +01:00
Jun Wu
56075d02ef fastannotate: encode directory names
Summary:
We need to reserve ".l", ".m" and ".lock". So encode directory names to
avoid collision.

Test Plan: Run the modified test

Reviewers: #sourcecontrol, stash

Reviewed By: stash

Subscribers: mjpieters

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

Signature: t1:3944069:1475166648:055811239514cb699a0ebe1cfab809b661c6cfd2
2016-09-29 16:33:46 +01:00
Jun Wu
89c9da2b06 fastannotate: add a --deleted option
Summary:
This feature uses the linelog to show all lines ever existed (even deleted) in
a file. Helpful to see the history all the way back to the beginning.

Sadly it has to be inefficient currently as we have chosen to not store line
content (but only numbers) in linelog. Calculating the revisions and line
numbers is very fast because of linelog but resolving the line contents is
painfully slow. We may want a key-value database in the future, answering the
query:

  (path, node, linenum) -> content

How slow is it? With the linelog pre-built, generating the output for
`mercurial/commands.py` needs resolving 400+ revisions and is about 10+
seconds.

Test Plan: Run the changed `test-fastannotate.t`

Reviewers: #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, mjpieters

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

Signature: t1:3849503:1475086235:83077c571746a7515b5ba75c4df37a1a400d9232
2016-09-11 22:52:29 +01:00
Jun Wu
58826b52c2 fastannotate: add a config option to replace the default command
Summary:
This diff adds a config option to replace the default annotate command using
fastannotate.

Test Plan: Run the modified test

Reviewers: #sourcecontrol, stash

Reviewed By: stash

Subscribers: mjpieters

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

Signature: t1:3837499:1475076620:65dc656c74e9c8a969f68cc4a2480f5dcbeb6361
2016-09-08 21:52:01 +01:00
Jun Wu
cfb2b51726 fastannotate: add a simple test
Summary: This diff adds a simple test for the `fastannotate` command.

Test Plan: Run the newly added test.

Reviewers: #sourcecontrol, stash

Reviewed By: stash

Subscribers: mjpieters

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

Signature: t1:3836677:1475076179:fa8b8ff3711a8dad9410a15f77e23adaeb676d5e
2016-09-08 20:16:19 +01:00
Jun Wu
efb6a83a3e smartlog: remove unused edge when indentnonpublic is set
Summary:
This patch removes the unused line and space so it looks a bit better:

```
 .
 .
 .
 | o          o
 | |          |
 | |          |
 | o          o
 |/          /
 |          |
 o          o
 .          .
 .          .
(before)   (after)
```

Due to the current implementation of graphlog, it's a bit hacky to achieve the
above effect.

Test Plan: Run `test-smartlog*.t`

Reviewers: #mercurial, ttung, mjpieters, durham

Reviewed By: durham

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

Signature: t1:3881516:1475170264:477c66b2372d04c4e5d7c8fbb69de30599706e5d
2016-09-17 02:22:36 +01:00
Jun Wu
4cc05e5d24 absorb: improve rename handling
Summary:
Previously `absorb` does not care too much about copies or renames and
assumesa file path only exists in every changeset of `stack[k:len(stack)]`,
but does not exist in any of `stack[0:k]`. If this assumption is not true,
absorb will likely crash.

This patch implements copy or rename handling correctly. After this patch,
renames happens to a single file is tracked correctly. Copies are ignored
by default. For the "double move" case, like:

  hg cp a a1
  hg cp a a2
  hg rm a

We only follow the first path (sorted alphabetically). In this case, changes
to "a1" could affect the content of "a" in a previous changeset, while changes
to "a2" couldn't.

Test Plan: Added a new test

Reviewers: durham, #sourcecontrol, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:3941438:1475166850:97461174619d469750146e25f6bff16dae19bd3d
2016-09-28 23:56:43 +01:00
Stanislau Hlebik
24be1a2da5 infinitepush: add bundle-store option to push
Summary:
--bundle-store option makes push go to bundle store
even if bookmark is not specified or bookmark doesn't match scratch branch pattern.
The main reason for the `--bundle-store` is to be able to push not a scratch bookmark, but a scratch commit, for example, `hg push -r . --bundle-store`.
It will be useful when we will save all the local commits in the bundlestore.

To do this:
1) Wrap `discovery.checkheads()` to allow push to scratch branch even if new head is created.
2) Make scratchbranchpat params advisory because now bookmark may not be specified.

Test Plan: Run `test-infinitepush-bundlestore.t`

Reviewers: mitrandir, rmcelroy, durham

Reviewed By: durham

Subscribers: mjpieters

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

Tasks: 12479677

Signature: t1:3862665:1475077612:7e02a5bdc1da28161e45029b1e3a38fe8223a305
2016-09-28 13:17:25 -07:00
Adam Simpkins
731fa392e6 unbreak the remotefilelog tests
Summary:
bc720745268b added a ui argument to the mutabledatapack() and
mutablehistorypack() constructors, but did not update the tests to pass in a ui
object, causing the tests to fail.

Test Plan: Ran the tests.

Reviewers: #fastmanifest, durham

Reviewed By: durham

Subscribers: net-systems-diffs@, yogeshwer, mjpieters

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

Signature: t1:3934065:1475077643:4c0c32f5efdb25d482128cc58f4ba903611cc959
2016-09-28 11:53:29 -07:00
Jun Wu
7b2453666a test-pushrebase-remotenames: add necessary spaces to fix the test 2016-09-26 19:55:06 +01:00
Jun Wu
ab6fe31fd1 test-remotefilelog-clone: fix the order of find output
Summary:
The order of `find` output is not guaranteed, so sort them and make the
output determined.

Test Plan: Run the test.

Reviewers: #sourcecontrol

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3925502
2016-09-26 19:52:32 +01:00
Jun Wu
fb6df93955 test-infinitepush: check mysql module before running tests
Summary:
`mysql` is required for the test. Otherwise it would error out:

```
   $ hg init repo
+  abort: No module named mysql!
+  [255]
   $ cd repo
```

Test Plan: Remove mysql python package and run the test, make sure it's skipped.

Reviewers: stash, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D3925440
2016-09-26 19:40:29 +01:00
Stanislau Hlebik
bbb7f15c99 pushrebase: cleanup
Summary: Remove unused imports + fix missing variable error in `_checkheads()`.

Test Plan: Added a new test.

Reviewers: quark, rmcelroy

Reviewed By: rmcelroy

Subscribers: mjpieters

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

Signature: t1:3862724:1474283118:deceacc683bb079eb7afb2ea34fb1e196f9bb18b
2016-09-26 01:48:13 -07:00
Arun Kulshreshtha
ce03ceb66c Add hg next --rebase
Summary:
This diff adds the --rebase option to the `hg next` command by extending
the evolve extension in the fbamend extension.

The --rebase option finds any child commits of the obsolete precursor to the
current commit, and rebases them onto the current commit before performing
`hg next`. This way, one can be in the middle of a stack of commits, amend one
in the middle, and do `hg next` without running `hg amend --fixup`. The next
commit will be correctly found, rebased, and updated to.

This is equivalent to:



  hg rebase -d . -r "children(OLD_HASH)" -k && hg next

Test Plan:
I tested this command by hand and created some unit tests. The basic way to test it is:

1. `hg init` a new repository.
2. Create a chain of 3 commits.
3. Amend the 2nd commit.
4. Run `hg next --rebase` and confirm that the 3rd commit was rebased and switched to.

The exact commands to do this are in tests/test-fbamend-nextrebase.t. This file also
contains test cases in which there are multiple child commits on the precursor, and cases
where there is a rebase conflict.

Reviewers: #sourcecontrol, durham

Reviewed By: durham

Subscribers: mjpieters, nain

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

Tasks: 13347995

Signature: t1:3910568:1474650102:8c7dd712afb9d36f29e1e73bb781e1d8e0870371
2016-09-23 10:39:36 -07:00
Kostia Balytskyi
ded4c889ca tests_: fix failures related to recent renames
Summary: We need to start fixing test failures to test hgbuild e2e :)

Test Plan: run-tests.py against changed files shows that these ones were fixed

Reviewers: quark, mjpieters, rmcelroy, simonfar

Subscribers: mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D3907217
2016-09-22 07:44:34 -07:00
Durham Goode
d62504e76d treemanifest: fix test picking up local ctreemanifest
Previously, the test would attempt to import the system ctreemanifest, which is
not what we should be testing. This fix adjusts the PYTHONPATH so that we load
the extensions from our repo, instead of the system.
2016-09-21 13:51:39 -07:00