Commit Graph

20594 Commits

Author SHA1 Message Date
Jun Wu
2b625d0753 wireproto: write eol for the remotefilelog error message
Summary:
"\n" will flush the line and that would probably solve the OSX test failure.

```
    --- tests/test-clone-uncompressed.t
    +++ tests/test-clone-uncompressed.t.err
    @@ -37,8 +37,8 @@
       > EOF
       $ hg clone --stream -U ssh://user@dummy/server blockedclone
       streaming all changes
    -  remote: unable to perform an implicit streaming clone - make sure remotefilelog is enabled
       abort: locking the remote repository failed
    +  remote: unable to perform an implicit streaming clone - make sure remotefilelog is enabled (no-eol)
       [255]
       $ hg clone --stream --config clone.requestfullclone=True -U ssh://user@dummy/server blockedclone
       streaming all changes
    ok
```

Reviewed By: DurhamG

Differential Revision: D7776998

fbshipit-source-id: f21c26e1bf7aa547cd79892f66521fb27cb2e77f
2018-04-26 13:34:29 -07:00
Durham Goode
e3f8f7fc38 clone: add stream_clone_options wireprotocol endpoint
Summary:
We want to allow blocking full repo streaming clones in certain
repositories (since they can take the lock and take a very long time) unless the
client has explicitly asked for it. The existing stream_out wire protocol has no
way of passing an option, so let's create a new endpoint.

Reviewed By: quark-zju

Differential Revision: D7763717

fbshipit-source-id: eace47143f8fdcc4c6e302b5c26678ccf56ca5d4
2018-04-25 13:54:54 -07:00
Durham Goode
e1ac4b80e0 metrics: add performance logging to important locations
Summary:
This logs timing data for:
- update
  - merge.update
  - mergedriver
  - applyupdates
  - workers
- fetches
  - pulls
  - remotefilelog prefetches
  - treemanifest prefetches
- status
  - dirstate walks
  - fsmonitor walks
  - watchman queries

Hopefully this will let us narrow down where time is going in a number of cases
where the profile data is ambigiuous or hard to come by.

Reviewed By: quark-zju

Differential Revision: D7681026

fbshipit-source-id: e6fe65c9a4d2f4e128f62ccb767a7cbe73b2649a
2018-04-23 10:51:21 -07:00
Phil Cohen
20f4e198ee metrics: create simple metrics framework
Summary: A stub class in metrics.py can be overwritten by dedicated implementations.

Reviewed By: quark-zju

Differential Revision: D7673553

fbshipit-source-id: f713abb3203d393e356f96fb834111ec2c37498a
2018-04-18 20:08:01 -07:00
Jun Wu
45c18ef40d dispatch: set norepo for cmdalias explicitly
Summary: This resolves a crash with nested aliases.

Reviewed By: singhsrb

Differential Revision: D7681011

fbshipit-source-id: 1c7df5d89de5dc9d970f2839d3b0d40ab3df49b8
2018-04-18 20:08:01 -07:00
Durham Goode
a4d4fb3e29 metrics: rename logblockedtimes to logmeasuredtimes
Summary:
In an upcoming diff I want to add more timing measurements for various
parts of the Mercurial code (like how long status takes, vs checkout, vs
prefetch, etc). Let's rename the logblockedtimes logic to be more generic, since
it is doing basically the same thing.

Reviewed By: singhsrb

Differential Revision: D7676406

fbshipit-source-id: 9aa8c90ce562fa3ad5b654f7b3191b2c16a440c2
2018-04-18 17:05:32 -07:00
Durham Goode
7ae20ad0fd logging: allow correlating hg commands with external jobs
Summary:
Some services like sandcastle want to be able to correlate their job
with specific hg commands in our scuba data. Let's allow them to specify a job
id we can filter on.

I considered having multiple columns, like job type and job id, but I figured
the service can use whatever format they like, and we can used derived columns
to filter on different parts of the string as needed.

Reviewed By: mjpieters

Differential Revision: D7672264

fbshipit-source-id: e4723274bad2812358176e71da791e759b346ac0
2018-04-18 13:47:48 -07:00
Kostia Balytskyi
b839b0f51e debugcommands: fix test-check-code
Differential Revision: D7666396

fbshipit-source-id: 29e49603f1ef086179dfe9c16d8dee2079f82c89
2018-04-18 02:32:30 -07:00
Jun Wu
c7d37f0c15 templater: fix document of capitalize
Summary:
The document was for ".title()". The code finally uses ".capitalize()" so
it's not capitalizing each word.

Quoting is changed to be consistent with the surrounding style.

Reviewed By: ryanmce

Differential Revision: D7658780

fbshipit-source-id: 4ad99d41cd8104dd382058a50752f88aa2116a0d
2018-04-17 17:42:26 -07:00
Kostia Balytskyi
cb1179cccb locks: make sure debuglocks knows about malformed locks and undolog lock
Summary: Let's report that this lock cannot be read by Mercurial

Reviewed By: markbt

Differential Revision: D7653196

fbshipit-source-id: c5b7889cdde9c0ecc03a8c961aeba92f426648b1
2018-04-17 17:42:26 -07:00
Kostia Balytskyi
46bc847b23 windows: improve lock file logic
Summary:
Quick experimentation shows that existing lock file logic is not enoug for
frequently run and killed Mercurial processes (Mercurial run by tools, such as
Nuclide is an example of such scenario)

I wrote the following two files:
```
c:\Code\tries\pythontries λ cat lockcreator.py
import os, random

def makelock(info, pathname):
    ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL)
    os.write(ld, info)
    # os.fsync(ld)
    os.close(ld)

name = os.path.join('locks', 'lock.pid' + str(os.getpid()) + ".rand" + str(random.randint(0, 10000)))
makelock('contents', name)
```
and
```
c:\Code\tries\pythontries λ cat lockracer.py
import os, subprocess, time, random

for i in xrange(10000):
    proc = subprocess.Popen('python lockcreator.py')
    time.sleep(0.001*random.randint(0, 500))
    proc.terminate()

```

After runnning `python lockracer.py`, I did `ls -l locks | grep "0 Apr"`, this way it showed all the 0-byte files created in April. This shows a non-empty output. Uncommenting the `os.fsync` line does not help much.

Rewriting `lockcreator.py` to use temp lock file approach helps greatly.

Reviewed By: quark-zju

Differential Revision: D7653186

fbshipit-source-id: 48e9eeeca34075ea2ec78f3319491bcebc0e88c7
2018-04-17 17:42:26 -07:00
Kostia Balytskyi
82f5d79c6b platform: make util.makelock platform-dependent
Summary: Just seaparating the concerns.

Reviewed By: markbt

Differential Revision: D7653209

fbshipit-source-id: 3c30d57cb7a0bc5a9195a190c50be67802065d13
2018-04-17 17:42:25 -07:00
Jun Wu
e319762ba8 util: use in-repo re2 library
Summary:
This avoids potential SEGSEGVs when the system re2 is ABI incompatible.

See D7622774 for more details.

Reviewed By: markbt

Differential Revision: D7622771

fbshipit-source-id: bae1500e7468881a7a19d3cb9074db583b2444a6
2018-04-17 16:35:25 -07:00
Jun Wu
84d6041a99 thirdparty: vendor pyre2
Summary:
We recently found issues where it seems "hg" in some environment uses an
ABI-incompatible re2 library and segfaults. pyre2 is small and was
originally written by Facebook for Mercurial use-case. So let's just vendor
it.

Reviewed By: markbt

Differential Revision: D7622774

fbshipit-source-id: db01183c9881bf9c3ed21fceed195b2059d40208
2018-04-17 16:35:25 -07:00
Mark Thomas
fea0693497 progress: improve perf of suspend when there are no progress bars
Summary:
Suspending the progress bar is achieved by taking the progress lock.  This has
a cost, which reduces performance even when there are no progress bars to
suspend.  This is particularly bad for commands that output lots of lines, e.g.
`hg files`.

Don't take the lock during suspend when there aren't any progress bars to
suspend.

Reviewed By: mjpieters

Differential Revision: D7652389

fbshipit-source-id: 627d893261228087b4cc84b90bf05b034cc60a40
2018-04-17 08:11:06 -07:00
Jun Wu
ea9d102dcd merge: log files being conflict resolved
Summary:
Similar to the previous patch, this allows us to get more information about
conflicts being resolved.

Reviewed By: phillco

Differential Revision: D7648933

fbshipit-source-id: 5b8c3dde385ace4c2a7cff7455e11436e5afd8cd
2018-04-16 20:53:58 -07:00
Jun Wu
99467186ae rcutil: use realpath to normalize paths for config editing
Summary: This resolves symlinks recursively.

Reviewed By: farnz

Differential Revision: D7639180

fbshipit-source-id: 9f2d29090a63cf0dfc997ae1c84095a2defe329e
2018-04-16 20:34:58 -07:00
Durham Goode
fa84b05e94 backout: backout lock change that broke a bunch of tests
Summary: Commit 23f4cd4264ef broke a bunch of tests. Let's back it out.

Reviewed By: singhsrb

Differential Revision: D7646736

fbshipit-source-id: ace9b7be2c50f64ea382eaa72a350ead67b2a2a6
2018-04-16 16:21:52 -07:00
Kostia Balytskyi
d8780740bd hg: make sure debuglock knows about malformed locks and undolog lock
Summary: Let's report that this lock cannot be read by Mercurial

Differential Revision: D7617178

fbshipit-source-id: 23f4cd4264ef6c685762d8f89e2c24ed2f224211
2018-04-16 12:53:41 -07:00
Kostia Balytskyi
aee6f00b5a hg: print an actionable error message if the lock file is malformed
Summary:
The recent changes to Mercurial made us less tolerant to wrongly-formatted
lock files.

Reviewed By: farnz

Differential Revision: D7586684

fbshipit-source-id: d7fa2151b8bb20f49c83941f7d3ef751fdbab2de
2018-04-16 12:53:41 -07:00
Liubov Dmitrieva
0cb0fd8709 improve smartlog for Commit Cloud user
Summary:
{F123775861}

Improve smartlog extension for Commit Cloud Users.

The difference with the current smartlog implementation is that in Commit Cloud world
a commit can be modified by a sequence of operations on another host and smartlog doesn't handle it.

After `hg cloudsync` run command we should be able to 'explain' in smartlog what has happened

this is important for user who opt out from 'updateonmove' feature because they will see two version of their stack all the time.

Reviewed By: DurhamG, quark-zju

Differential Revision: D7492969

fbshipit-source-id: 9ac2180f9abaa9ae596620b7f25d9ad8212deb28
2018-04-16 12:53:41 -07:00
Jun Wu
29ea02db78 hint: silence all hints by HGPLAIN=hint
Summary: `HGPLAIN` could specify features. Let's use it.

Reviewed By: farnz

Differential Revision: D7639140

fbshipit-source-id: 5e9215221a8eb6a6a14f2eaba326c19feb114811
2018-04-16 10:35:15 -07:00
Jun Wu
824875b403 matcher: define __repr__
Summary:
fsmonitor relies on `repr(match)` to check ignore changes. `__repr__` is not
defined by `negatematcher`. That leads to unnecessary fsmonitor state
invalidation.

This diff fixed that by defining `__repr__` on the base matcher class.

Reviewed By: singhsrb

Differential Revision: D7619774

fbshipit-source-id: df55390411cdb2d8e22e65efdeeb3b1db3bfa284
2018-04-13 21:51:55 -07:00
Durham Goode
c679adb7d0 hg: remove bundlev1 from the supported outgoing versions
Summary:
Removes bundlev1 from the supported outgoing versions, but keeps a flag
around to force enable it if tests need it.

Reviewed By: quark-zju

Differential Revision: D7591176

fbshipit-source-id: 280cbbbe87848e3d6c9d448ce4f87c5eadeff720
2018-04-13 21:51:53 -07:00
Durham Goode
e02f8031d7 hg: change default bundle version to v2
Summary:
Bundlev1 is old and really shouldn't be used anywhere. Let's default to
v2.

Reviewed By: quark-zju

Differential Revision: D7591172

fbshipit-source-id: 2699e0b4dd8d1c1951f9dd92f0d9d300d935a04b
2018-04-13 21:51:53 -07:00
Durham Goode
24653e5e32 hg: add develwarn for bundle1 format
Summary:
We want to deprecate the bundlev1 format, so let's start by adding a
develwarn. Later diffs will update the tests to not use v1, then remove v1 as a
supported outgoing bundle entirely.

Reviewed By: quark-zju

Differential Revision: D7591166

fbshipit-source-id: 143ad029bfe4d141f91d6d5077342dfa44ad2944
2018-04-13 21:51:52 -07:00
Mark Thomas
9979530751 sshpeer: add timeblockedsection for ssh setup
Summary:
We would like to know how much time is spent setting up ssh connections.  Add a
timeblockedsection to sshpeer that records the amount of time between starting
the ssh command, and getting (and validating) the response for the `hello` and
`between` commands.

Reviewed By: ryanmce, farnz

Differential Revision: D7584383

fbshipit-source-id: fd3c48dc57e0ebbafc191c235355ce2330c6bd61
2018-04-13 21:51:52 -07:00
Kostia Balytskyi
e53224ec32 hg: add even more debug messaging around locks
Summary: We've seen a case when a malformed `wlock.break` file prevented the stale lock file from being deleted. It seems unsafe to just delete the `wlock.break`, but we can add more debug messaging before it, so that rerunning a command with `--debug` would tell us what is going on.

Reviewed By: quark-zju

Differential Revision: D7572510

fbshipit-source-id: 5456ae6dbff3721bbd40c6ed55e173beabac3f65
2018-04-13 21:51:52 -07:00
Jun Wu
1caa774e95 amend: abort if unresolved merge conflicts found (issue5805)
Summary:
Backport from:

```
  # HG changeset patch
  # User Yuya Nishihara <yuya@tcha.org>
  # Date 1520766638 -32400
  #      Sun Mar 11 20:10:38 2018 +0900
  # Branch stable
  # Node ID eeb87b24aea7f547f6d95b812dd080dc6e9ab194
  # Parent  9639c433be54191b4136b48fe70fc8344d2b5db2
  amend: abort if unresolved merge conflicts found (issue5805)

  It was checked by repo.commit() before e8a7c1a0565a "cmdutil: remove the
  redundant commit during amend."
```

Differential Revision: D7517547

fbshipit-source-id: fd585bc4dceb837e8486b1285ed7ff14d24795d3
2018-04-13 21:51:51 -07:00
Mark Thomas
f1ebfba3dc progress: deactivate the progress thread when shutting down
Summary:
The progress bar thread is a daemon thread, so that it doesn't need to be
deactivated manually.  However, this means the thread terminates and the lock
is released during interpreter shutdown.  Because Python clears module
attributes at the start of interpreter shutdown (see [1]), releasing the lock
fails as it can no longer get the thread identity.

To mitigate this, we register an atexit handler to terminate and join to the
progress bar thread.

[1] https://stackoverflow.com/questions/25649676/where-is-pythons-shutdown-procedure-documented

Differential Revision: D7568155

fbshipit-source-id: 85ef10af6c1576d5beceb78f8514e0e440cdab7f
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
88b296f51b hg: add more debug output to the _testlock function
Summary: We want to know what is the reason why we think the lock file can't be removed.

Reviewed By: farnz

Differential Revision: D7513954

fbshipit-source-id: fd1668e7a614e5e24e250018fbc880ba87821aa8
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
14e5b61eaf hg: add process startime to lock unique id
Summary:
This helps with PID reuse, which can cause false positives when checking
whether the lock-owning process is still alive.

Reviewed By: mjpieters

Differential Revision: D7513955

fbshipit-source-id: d3df4b4afa53cd1e9633d71c294cf7014b7b65c5
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
e516de21d5 hg: introduce a Locker class for lock-owner processes
Summary:
The goal of this diff is to introduce a central place for all logic related
to parsing and handling the contents of the lock files. The current state of
things is hard to manage and even harder to extend.

NB: the stack is not complete, the changes that actually use this refactoring are yet to come.

Reviewed By: quark-zju

Differential Revision: D7489326

fbshipit-source-id: aa79d964411e3f5b61e24aa9babece05d4f0bd60
2018-04-13 21:51:51 -07:00
Kostia Balytskyi
d612e92d9f hg: add process start time query function
Summary:
This will later be used to add a bit of uniqueness to PIDs on Windows, to
address the stale lock problem.

Reviewed By: quark-zju

Differential Revision: D7489325

fbshipit-source-id: b866bd239eacfc7fe64433f0989a73dff1246644
2018-04-13 21:51:51 -07:00
Jun Wu
b43606ee98 ignore: add a way to disable hgignore
Summary:
This allows us to turn on and off hgignore support directly without changing
files in the working copy (which could be hard to revert cleanly).

Reviewed By: mjpieters

Differential Revision: D7544529

fbshipit-source-id: 14cc41e2ae361070f91bf3b8aa28dd5808e7fe99
2018-04-13 21:51:49 -07:00
Jun Wu
7de540805d setup: build rust extensions in a shared directory
Summary:
This avoids building shared dependencies (ex. regex) over and over. The only
downside is cargo will take a lock and cannot build projects in parallel.
But `setup.py` does not support building extensions in parallel. So it's
fine.

Changed `matcher` to also enable lto like existing extensions, so `cpython`
build result can be reused.

Before (on devserver):

  $ time python setup.py build_rust_ext
  real    2m19.401s
  user    3m35.118s
  sys     0m8.277s
  $ du -hs build/temp.linux-x86_64-2.7/
  115M    build/temp.linux-x86_64-2.7/

After:

  $ time python setup.py build_rust_ext
  real    2m4.371s
  user    2m25.864s
  sys     0m5.198s
  $ du -hs build/temp.linux-x86_64-2.7/
  58M     build/temp.linux-x86_64-2.7/

`cargo` builds things in parallel. The speed improvement would be more
significant on laptops.

Differential Revision: D7512429

fbshipit-source-id: 378e721890bdfe53c8adbe364ad5f0b374023ff5
2018-04-13 21:51:49 -07:00
Stanislau Hlebik
2355414e71 mercurial: improve graft error message
Summary:
Previously `hg graft -r 'ancestor::descendant` printed no error message at all.
This diff fixes it.

Reviewed By: mjpieters

Differential Revision: D7533498

fbshipit-source-id: 5c4e41ecc3178495ad2f41ef53ef65f7fbb70212
2018-04-13 21:51:49 -07:00
Jun Wu
0252fce55c hint: add a command to silence hints
Summary:
This allows people to silence hints as they like. It's done by modifying
user hgrc.

Reviewed By: markbt

Differential Revision: D7392133

fbshipit-source-id: 1365294217db92dfb3a0c81332a9fefd164795d4
2018-04-13 21:51:49 -07:00
Jun Wu
247f398309 rcutil: add a way to edit config files in-place
Summary: This allows us to change configs using code.

Reviewed By: mjpieters

Differential Revision: D7392129

fbshipit-source-id: 0960d4a322d6906469a79976031ab2b619dfa183
2018-04-13 21:51:49 -07:00
Jun Wu
14783221f6 hint: add a simple framework for registering hint messages
Summary:
This allows us to have a unified way to print hint messages at the end of a
command. It would be helpful for feature discovery in general.

Reviewed By: mjpieters

Differential Revision: D7392132

fbshipit-source-id: 8b4e94cc2176266652459ecca3428bd86d95bfe2
2018-04-13 21:51:48 -07:00
Jun Wu
bdbf60f28d xdiff: backport upstream changes
Summary:
I did some extra xdiff changes in upstream, namely:

  - Remove unused features
  - Replace "long" (32-bit in MSVC) with int64_t to support large files
  - Add comment on some key variables

This backports them. It also includes Matt's fixes about Windows compatibility.

Reviewed By: ryanmce

Differential Revision: D7223939

fbshipit-source-id: 9287d5be22dae4ab41b05b3a4c160d836b5714a6
2018-04-13 21:51:48 -07:00
Jun Wu
b0b9ac188f chg: work with illformed envp
Summary:
By using low-level APIs, `environ` could contain ill-formed entries that do
not have the `NAME=VAL` form:

  #define _GNU_SOURCE
  #include <unistd.h>
  char *envp[] = { "X", 0 };
  char *argv[] = { "hg", "log", 0 };
  int main() {
      return execvpe("chg", argv, envp);
  }

Ignore them silently so they won't break chg.

Reviewed By: DurhamG

Differential Revision: D7537406

fbshipit-source-id: 3fef3d656383723d451fbfa29ba9a9fa170311d0
2018-04-13 21:51:48 -07:00
Kostia Balytskyi
e1f2cac08e hg: use Windows libraries in a way that preserves GetLastError
Summary:
Using windows libs like `_kernel32 = ctypes.windll.kernel32` means that
the `GetLastError` calls are useless.

(1317 is a non-existent process)
```
In [44]: k32 = ctypes.WinDLL('kernel32', use_last_error=True)

In [52]: ctypes.windll.kernel32.OpenProcess(0x0001, False, 1317)
Out[52]: 0

In [53]: ctypes.windll.kernel32.GetLastError()
Out[53]: 0

In [54]: k32.OpenProcess(0x0001, False, 1317)
Out[54]: 0

In [55]: k32.GetLastError()
Out[55]: 5
```

This behavior can explain why we can't auto-delete the stale lock file. See the `testpid` code:
```
def testpid(pid):
    '''return True if pid is still running or unable to
    determine, False otherwise'''
    h = _kernel32.OpenProcess(_PROCESS_QUERY_INFORMATION, False, pid)
    if h:
        try:
            status = _DWORD()
            if _kernel32.GetExitCodeProcess(h, ctypes.byref(status)):
                return status.value == _STILL_ACTIVE
        finally:
            _kernel32.CloseHandle(h)
    return _kernel32.GetLastError() != _ERROR_INVALID_PARAMETER
```

The non-existent `pid` causes `h` to be `0` and `_kernel.GetLastError()` to also be `0` (see above why). This means that we think that this process exists!

(Note: this ignores all push blocking failures!)

Reviewed By: quark-zju

Differential Revision: D7519457

fbshipit-source-id: c08f727228073962359e93db13f1fdb76f3699e6
2018-04-13 21:51:47 -07:00
Chad Austin
26464349a5 improve exception message when backupfiles format is invalid
Summary:
When a .backupfiles file is invalid, hg recover gives a not very
useful stack trace.  This makes it a bit easier to debug.

Reviewed By: DurhamG

Differential Revision: D7482578

fbshipit-source-id: e8c7ad73bb14a38d2d43b636d60a3b77cd947331
2018-04-13 21:51:47 -07:00
Durham Goode
32ac5d0647 hg: make pull use the connectionpool
Summary:
This makes hg pull use the connectionpool. This means prefetches can
reuse the existing ssh connection when appropriate. This both speeds up
prefetches, and also means they will speak to the same server that served the
pull.

Reviewed By: ryanmce

Differential Revision: D7481107

fbshipit-source-id: f9a3670527cb7e8956029c86d50d8e030dd3cc01
2018-04-13 21:51:45 -07:00
Durham Goode
77de196aa5 hg: move connectionpool to core Mercurial
Summary:
Previously the connectionpool was a remotefilelog specific concept. We
want to start sharing connections between pull and prefetches, so let's move it
to core Mercurial.

Reviewed By: ryanmce, phillco

Differential Revision: D7480670

fbshipit-source-id: 1b2eff3b0e61a815709ffaec35df802eeda0c24b
2018-04-13 21:51:45 -07:00
Mark Thomas
9e898effa5 debugcommands: show fallback colors in debugcolor --style
Summary:
`hg debugcolor --style` shows the component parts of each style individually,
however this doesn't work if the styles are defined as the new fallback styles
(separated by colons).  This is because the fallback is only implemented for
actual style names - it doesn't work for `ui.label('brightblue:blue', 'text')`.

It's usefule to see what the fallbacks are (even if they're not necessary on
your own system), so change debugcolor to split the elements of the fallback
style and show them separately.

Reviewed By: quark-zju

Differential Revision: D7485545

fbshipit-source-id: dce7204c9f0a98bb730b3ba864db28a9ec52a339
2018-04-13 21:51:45 -07:00
Jun Wu
d0886b9b94 gitignore: add a config option
Summary:
gitignore could have performance issues stating .gitignore files everywhere.
That happens if watchman returns O(working copy) files. Add a config to
disable it as we're finding solutions.

Reviewed By: DurhamG

Differential Revision: D7482499

fbshipit-source-id: 4c9247b0318bf034c8e9af4b74c21110cc598714
2018-04-13 21:51:45 -07:00
Phil Cohen
cb90ed6abe rebase: allow the working copy to be rebased with IMM
Summary:
After testing locally, I couldn't conclusively prove if rebasing a single change with IMM was any faster or slower than on disk.

Using IMM on the working copy will definitely be better for rebasing stacks, and it's just nicer to not have the working copy thrash around as much. It also might be interesting to (possibly) let you work while the rebase is running, too.* So I've added the code that will let us enable this more widely (as a subset of IMM) to experiment.

*I've made it so that if you make any changes during the rebase (causing the last update to fail), we just print a nice message telling you to checkout the new rebased working copy commit, instead of failing/aborting. TBD whether this is something we want to encourage people to do, however. I've kept the existing up-front check for uncommited changes when rebasing the WCP with IMM for now.

Reviewed By: DurhamG

Differential Revision: D7051282

fbshipit-source-id: c04302539021f481c17e47c23d3f4d8b3ed59db6
2018-04-13 21:51:43 -07:00
Durham Goode
9c3ff85ad8 hg: move bundle2 error part creation to a helper
Summary:
Since error parts pass the message and hint as parameters instead of
payload, they are limited to 255 characters. Let's add a helper function to
enforce this.

Reviewed By: quark-zju

Differential Revision: D7448104

fbshipit-source-id: 33d47a21e7159b6c4bd72cad9669568b92a51e34
2018-04-13 21:51:41 -07:00