Test Plan:
arc unit
Note: making sure that int is passed in repo.lookup(...) is not easy.
For example `hg log -r 1` does not pass an int value to repo.lookup().
But `hg bundle` actually does it so use `hg bundle` to verify that fix works.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4825996
Signature: t1:4825996:1491292671:9bd0897205dff93cb6dee75498827b3826f894da
Summary:
The ideal interactive mode couldn't be implemented trivially. Move `absorb`
to a directory so we can add related, but decoupled components as separate
files.
Test Plan: `make local`
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4813909
Signature: t1:4813909:1491211561:e9c40b1242c9b74230c0b8937723a2d4548e22c3
Summary:
This diff makes the `test-lfs.t` much more stronger. It reveals a lot of core
hg issues in this area. I'll send patches to fix them all.
Regarding on lfs, there are some changes:
- An existence check in its push hook was added. Otherwise pushing a revision
with rename will cause crash.
- The "read" processor is responsible for downloading blobs, and translate
raw revision to lfs text. It should always return lfs text. But it may
return raw revision text on error currently. That error handler was
removed to avoid further damage.
Test Plan: Added new test cases. I also added `hg verify` to sanity check things are good.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4792641
Signature: t1:4792641:1490868946:8f09c84dc9ebda3889d6a1ea04c49a06acbf38a3
Summary:
If the user does not have necesary credentials defined in their arc
configuration, catch the KeyError and convert it into an ArcConfigError.
The existing call sites in the phabstatus and arcdiff extensions catch and
handle ArcConfigError, but not generic KeyErrors.
This also fixes the phabstatus warning messages to end with a newline.
Test Plan: Added a unit test.
Reviewers: #sourcecontrol, quark, simonfar, wez, rmcelroy
Reviewed By: wez, rmcelroy
Subscribers: rmcelroy, net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4800977
Tasks: 17002914
Signature: t1:4800977:1490847078:e18bba042e3ff57100e0a7b25c610b5cad17fa2e
Summary:
Neither gitnode() template nor gitnode() revset worked on the server. They
both called `hg.peer(repo, {}, 'default)` and since 'default' is not a valid
url these calls failed. To fix it let's wrap `localrepo.lookup()` and call
local repo instead of peer repo if we can't find default path.
Test Plan: arc unit
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4794488
Tasks: 16848812
Signature: t1:4794488:1490795600:24269507f24613883406f0c1838fce302f86df58
Summary:
Previously we copied the old bundle dirmancache entries into the new bundle
dirmancache entries, but that missed any manifests that weren't already in the
cache. Since we have a list of bundle revs that are guaranteed to be needed
during the rebase, lets read them before the lock and force them into the cache
after the lock.
Test Plan:
Ran all pushrebase tests with a block like:
```
bundle.manifestlog[mfnode].read()
realmf = newdirmancache[''][mfnode].read()
if realmf.text() != mfdict.text():
raise Exception("cache invalid")
```
...to verify the manifest we cached is the same as can be read from disk.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4774728
Signature: t1:4774728:1490736995:6e20d69181b4df76aeb800ea246a0dae0a4b802d
Summary:
This fetches the old master's full text before the lock is taken, and puts it in
the revlog._cache field so we don't have to read the full delta chain when we go
to read the latest master revision. This minimizes the amount of time we have to
spend processing the manifest during the first write.
Test Plan:
Ran all tests using a block like the following:
```
for mfnode, mfdict in bundlerepocache.iteritems():
bundle.manifestlog[mfnode].read()
existing = newdirmancache[""][mfnode].read().text()
new = mfdict.text()
if new != existing:
raise Exception("Cache failed")
```
...which raises if the data we were about to pull from the cache was different from what we were reading from the manifest before.
Reviewers: #mercurial, durham, rmcelroy
Reviewed By: durham
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4774716
Signature: t1:4774716:1490735677:85bac79999d607f5554d090978d0ee6787f5e11c
Summary:
Previously, pushrebase detected if it was ok to rebase a commit by diff'ing the
original common ancestor of the bundle and master with the new master. This
required reading both manifests. To improve performance, let's read the
changelog files list instead, which is much, much faster.
Merge commits don't have a files list that is representative of the actual diff,
so fall back to manifest diff in that case.
Test Plan: ran tests
Reviewers: #mercurial, stash, durham
Reviewed By: stash, durham
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4774694
Signature: t1:4774694:1490601056:18f78ab7c3e35a1beb2a7775160271a3311e38bb
Summary:
Previously `lfs.blobstore` must be a relative path. If an absolute
blobstore path is set, it will traceback because vfs audit fails:
```
File "hg/mercurial/revlog.py", line 1356, in _processflags
text, vhash = writetransform(self, text)
File "fb-hgext/hgext3rd/lfs/wrapper.py", line 69, in writetostore
blobstore.local.get(self.opener).write(storeid, chunk)
File "fb-hgext/hgext3rd/lfs/blobstore.py", line 41, in write
fp = self._opener(self.filename(storeid), 'w+', atomictemp=True)
File "hg/mercurial/vfs.py", line 344, in __call__
self.audit(path)
File "hg/mercurial/pathutil.py", line 64, in __call__
raise error.Abort(_("path contains illegal component: %s") % path)
Abort: path contains illegal component: /home/quark/lfslocalblobstore/d7/dbc611df1fe7dfacfe267a2bfd32ba8fc27ad16aa72af7e6c553a120b92f18
```
That was because the code was using `repo.vfs`. This diff adds a new `lfsvfs`
to avoid the issue. The `lfsvfs` also did the correct filename check (the
old `re.match` check will not match the whole string), so `blobstore.local`
could be simplified a lot.
Test Plan:
A new test case was added to make sure absolute blobstore path works. I also
did some cleanups for the test file to de-dup hgrc, and avoid writing files
outside `$TESTTMP`.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters, remi
Differential Revision: https://phabricator.intern.facebook.com/D4785084
Signature: t1:4785084:1490693306:b42eef8e53af107897c2e1bc2984c090bdd2e465
Summary:
The core mercurial could now detect filesystem for Linux and OSX, and enable
real hardlink support for their major filesystems. So the hardlink tweak is no
longer needed.
Test Plan: `arc unit`
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4776139
Signature: t1:4776139:1490601097:0be66e2a0111b71a932b453ef4e1e75fed8276e6
Summary:
A bunch of modifications to get the test pass with the new lfs code.
- Move `lfs` to `hgext3rd`. The code was supposed for hg-core. For now, we do
them in fb-hgext to speed up the process
- Remove the windows test, which is not supported by `run-tests.py` and is
duplicated with `test-lfs.t`.
- Do import `mercurial.i18n._` correctly.
- Change some i18n logic a bit so it's more translator-friendly.
- Change `revlog.RevlogError` to `error.RevlogError`.
- Avoid direct symbol import of `mercurial.util.bytecount`, which will fail the
upstream importchecker test.
- Fix various lint issues like lines being too long etc.
- Document lfs config options.
Test Plan: `arc unit`
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4772216
Signature: t1:4772216:1490401458:1ad3c18ab80e1d31085d0b6b4c630e62a7dc7930
Summary: test-check-code.t now dislikes our docstrings. Fix them up
Test Plan: Run the test locally on my devserver
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4773908
Signature: t1:4773908:1490394131:9d9e5f85b4243119a3615044605bcc5abdecbe4f
Summary: `resource` is UNIX-only module, we can't use it if we want `pushrebase` to work on Windows. As we only use `getpagesize()`, we can also do `mmap.PAGESIZE` instead.
Test Plan: - apply change on Linux, see that they do not introduce any new failures
Reviewers: #sourcecontrol, durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4762553
Signature: t1:4762553:1490294453:fdcb2e9caa38f5d14eafc6ff36a1bb7d9429b6e9
Summary:
Hardlink backups are significantly cheaper than file copies. They are
disabled in core because they are problematic on CIFS.
Test Plan: Ran the tests.
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4652490
Tasks: 16406729
Summary:
It will allow sparse to not ignore the file, and is more consistent with
other special files.
Test Plan: Updated existing tests
Reviewers: rmcelroy, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4738766
Signature: t1:4738766:1490032493:199f3fef9c74a137b16ae7637b87de625ca5115d
Summary:
We forgot one more store file: obsinhibit.
This diff adds it
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4714522
Tasks: 16558840
Signature: t1:4714522:1489717585:fdabf3c5f0c11310708ba3d78df39cbaa04a3afa
Summary:
This diff just restores the code that was reverted before. Next diffs will fix
it
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4714397
Tasks: 16558840
Signature: t1:4714397:1489717436:9777d783d1443dea46460450e8f3da862c147483
Summary:
It'd be nice to have dirsync config in the repo, since it's better synced, and
easier to be modified.
Test Plan: Added a test case
Reviewers: #sourcecontrol, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4732054
Signature: t1:4732054:1489793650:ca6c63ef47a1d9ebd181fbaee5554975801324eb
Summary:
We have encountered a kernel issue where `rmdir` a non-empty directory may race
with other things and hang in kernel for a long time.
This patch changes `os.rmdir` to avoid `rmdir` non-empty directories. It is
written in Cython calling the low-level `readdir` libc friends to make overhead
minimal.
Test Plan: Added a new test
Reviewers: #sourcecontrol, clm, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, simpkins, osandov, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4716711
Tasks: 16647532
Signature: t1:4716711:1489627923:7c7432748c1fd8c070ce257bd172feebd3807f65
Summary:
It's just copy-paste from my mutable-history patch series that ended up as
persistent hotfix.
The wrapping logic is very simple: it redirects '--fold' calls to original
metaedit and handles all the rest.
Test Plan:
Included a big copy-pase from test-evolve.t preserving only cases that were
executing metaedit and modified for the smaller test repo (the metaedit tests
were at the end of evolve test file).
Reviewers: #sourcecontrol, quark, simonfar
Reviewed By: quark, simonfar
Subscribers: rmcelroy, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4708017
Signature: t1:4708017:1489524494:d682aab857e8422bb1a23adc22dddfb9f505b6b3
Summary:
The upstream has changed how color works. `chistedit` seems to use a very hacky
way to disable color. Let's use a safer and simpler approach.
Test Plan: Run chistedit with hg-committed.
Reviewers: #sourcecontrol, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4702229
Signature: t1:4702229:1489446376:f0c7b4d31eb62bb6aea4cfeb13d78be8c219374c
Summary: The poorly formatted docstring was causing an extra blank line to be inserted both before and after the content
Test Plan: Changed a binary in an hg repo. Committed interactively using the editor. Made sure that there were no blank lines
Reviewers: rmcelroy, quark, simonfar
Reviewed By: simonfar
Subscribers: most, asriram, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4684549
Tasks: 15728734
Signature: t1:4684549:1489269897:faecd381c98e8c2b9884f9bacd18dfc32ee77758
Summary:
Previously, the rebase logic itself would unlink its state file. Now that the
state file is part of the transaction, it gets serialized at the end of the
transaction, even if it was unlinked midway through the transaction. This
affects fbamend because it wraps various rebases in a higher transaction.
Ideally we would add support to the mercurial transaction framework to allow
marking a file as deleted halfway through the transaction, but this patch will
fix the tests until we get that upstream.
Test Plan: Tests now pass
Reviewers: kulshrax, #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4696578
Signature: t1:4696578:1489348040:b12104b2519d69dab98d2076f640f9f3157036e2
Summary:
Upstream changed the format from ['diff ...\n', 'file1\nfile2\nchunks...'] to be
['diff ...\nfile1\nfile2\n', 'chunks...'] in 199440c7d1f49752. So grepdiff needs
to be updated.
Test Plan: Tests now pass
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4695911
Signature: t1:4695911:1489282635:920e88fecc5d6d4660d1d21289d1d07e26c93315
Summary: Let's add option that contains a list of other config options to log.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4681336
Signature: t1:4681336:1489171115:dddd27032e945f37fcc846a511e3aaa9e83d29d3
Summary:
Upstream has added a new match argument to manifest.diff() and removed the
existing manifest.matches() function, so we need to update our internal usage.
A separate diff will update treemanifest to support the new diff() api.
Test Plan:
Ran the tests, some still fail because of the upstream changes, but
future patches fix those.
Reviewers: #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D4677002
Summary: This diff adds a `--towards` flag to `hg next`. This flag tells `hg next` to always proceed in a linear fashion towards the specified commit. This is useful in situations where the user has a very branchy stack. For example, if the user has a local stack with several branches, each with a feature bookmark at the top, if the user wants to go up a particular stack they can do so with something like `hg next 3 --towards bookmark`.
Test Plan:
Here is an example of basic usage. Also see test file.
```
$ hg debugbuilddag "+5 *2 +2"
$ hg book -r 4 feature1
$ hg book -r 7 feature2
$ hg up 0
$ hg sl
o 92eaf3 debugbuilddag feature2
| r7
|
o 8bbe84 debugbuilddag
| r6
|
o 914970 debugbuilddag
| r5
|
| o bebd16 debugbuilddag feature1
| | r4
| |
| o 2dc09a debugbuilddag
| | r3
| |
| o 012414 debugbuilddag
|/ r2
|
o 66f7d4 debugbuilddag
| r1
|
@ 1ea734 debugbuilddag
r0
$ hg next 3 --towards feature1
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
[2dc09a] r3
$ hg sl
o 92eaf3 debugbuilddag feature2
| r7
|
o 8bbe84 debugbuilddag
| r6
|
o 914970 debugbuilddag
| r5
|
| o bebd16 debugbuilddag feature1
| | r4
| |
| @ 2dc09a debugbuilddag
| | r3
| |
| o 012414 debugbuilddag
|/ r2
|
o 66f7d4 debugbuilddag
| r1
|
o 1ea734 debugbuilddag
r0
```
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4695861
Signature: t1:4695861:1489325959:1145a29ba87f99d07ede1e81415804723dc48818
Summary:
The computehidden caching functionality doesn't seem to be correct, and breaks
my repository. "hg log -r head()" now incorrectly reports some obsolete
commits, which causes various mercurial commands to crash. (They incorrectly
think that these commits aren't obsolete, but their parents are obsolete, which
breaks things.)
This diff reverts the new functionality until it gets fixed.
Test Plan: Confirmed that "hg-dev pull" no longer crashes in my repository.
Reviewers: #mercurial, stash, durham, quark
Reviewed By: quark
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4676573
Tasks: 16558840
Signature: t1:4676573:1489008220:f730da69ec0f8d7220cad16ea6956944cfeb670d
Summary: Previously, we were relying on the `allowunstable` extension to wrap various instability-inducing commands and set the appropriate config option to cause the `tweakdefaults` extension to write the correct operation metadata into the obsmarkers produced by each respective command, causing commits to show up as "amended as", "rebased as", etc, in `hg sl`. Since the operation name was based on the command being run, if a user ran `hg amend --fixup` instead of `hg restack`, for example, smartlog would say "amended as" instead of "rebased as". This diff fixes the problem by always setting the operation to "rebase" during a restack.
Test Plan:
1. Create a stack of two commits.
2. Amend the bottom one without `--rebase`.
3. Run `hg amend --fixup` with the `fbamend.userestack` config option enabled.
4. Run `hg sl --hidden` and observe that the rebased commit is marked as "rebased".
See test file for an example.
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4670066
Tasks: 16529478
Signature: t1:4670066:1488991076:58c139c50a1aab2aa4fc7e28b1efd57a67bdfb08
Summary:
Sometimes the hg process gets stuck, and we want to get the stack traces to
learn what it's doing. It's not a big issue if gdb can be used with python
debugging support [1]. However, that feature could not be easily set up on
OS X. This extension will make debugging on OS X easier by providing the
Python stack traces on SIGUSR1.
It's similar to OpenStack's "GuruMeditationReport" feature [2].
Unlike `contrib/showsstack.py`, this extension uses SIGUSR1 instead of SIGQUIT,
and writes to a file, instead of stderr, and prints all threads, instead of
just the current one. So it's more practically useful. We may want to
replace `showstack.py` eventually.
[1]: https://wiki.python.org/moin/DebuggingWithGdb
[2]: https://wiki.openstack.org/wiki/GuruMeditationReport
Test Plan: Added a new test
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4660938
Signature: t1:4660938:1488927878:c751856681816a739160c361ed5cc10bab325000
Summary:
Upstream changed the api of this function. Let's add args and kwargs to cover
future api changes.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4667282
Signature: t1:4667282:1488910879:7db5764704dd345946f7f933e7e2c4a8fd77b699
Summary:
Upstream has deprecated repo.*opener properties, so we need to switch to the
equivalent vfs apis to prevent us from being spammed with deprecation warnings.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4667252
Signature: t1:4667252:1488911019:efc3adf21f723151f1ee3b21b91fe62ea3c7b259
Summary:
Computing cache key can be quite slow (100ms and even more). Instead let's use
a simpler cache key: size + mtime of phaseroots, obsstore and changelod and
whether changelog write was delayed.
Test Plan:
1) arc unit
2) Run test-newhiddencache.t
3) Run upstream unittest with extension enabled.
python run-tests.py --extra-config-opt extensions.newhiddencachekey=/home/stash/facebook-hg-rpms/fb-hgext/hgext3rd/newhiddencachekey.py -j20
Verify that there are no failures except for those that show that new extension were added.
Note: also need to comment out debug output in the extension
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4604811
Signature: t1:4604811:1487958882:702ea8fdee16def674db97344832936d53f0cd9d
Summary:
Upstream mercurial doesn't run hooks for temporary amended commits
(see https://bz.mercurial-scm.org/show_bug.cgi?id=3501 and
c2ca20984e3c9f30d73f0f35c35904b64edbd692). No other hook contains info about
temporary amended commits.
Let's wrap localrepository.commit() function and add missing commits inside
this wrapper.
Test Plan: arc unit
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4634950
Tasks: 16387175
Signature: t1:4634950:1488399457:1d299c6ad3cfd418dda32a7ec20c60290f8d7778
Summary:
It makes it easier to set up a hook - just enabling the extension will enable
the hook.
Test Plan:
Run perl script
system("echo 1 >> 1");
system("hg add 1");
system("hg ci -m"."\x80");
system("hg ci -m"."\x01");
system("hg ci -m ok");
make sure only one commit was created
Reviewers: #sourcecontrol, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4604980
Tasks: 16212973
Signature: t1:4604980:1487944300:8e4e7f340c746237b47773fc81759025e97b919e
Summary:
bundlerepo adds new commits that are not present in fastpartialmatch index.
Without this diff any access to the commit from bundle fails if
fastpartialmatch.raiseifinconsistent config option is set.
Let's not use fastpartialmatch in bundlerepos
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4635368
Tasks: 16394593
Signature: t1:4635368:1488393506:15b8f6a9fddabe681de7fd1296bbfafb9512f558
Summary:
Turned out that wrapping `changectx.__init__()` doesn't give any performance
benefits but instead it breaks initializing of changectx. For example, if
there is a commit which revision number N is a prefix of another commit A then
`hg log -r N` outputs commit A instead of commit N. Let's get rid of this
wrapping.
Test Plan: arc unit
Reviewers: #mercurial, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4635311
Tasks: 16394593
Signature: t1:4635311:1488393427:eae091a0d155df336adbb122f2881a28e95ba6b6
Summary:
The sparse profile in .hg/sparse currently only can grow, removing rules from this must either be done manually (by editing the file), or one by one using the the -d/--delete command line switch.
To mirror the hg sparse --import-rules command line, hg sparse --clear-rules removes local includes/excludes rules.
Test Plan: fb-hgext/tests/test-sparse-clear.t
Reviewers: marianomartin, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4609102
Tasks: 16073155
Signature: t1:4609102:1488028035:f5f7b7420d911667fb4a07ac770b7e0480a76977
Summary:
We have users who don't use inhibit, so printing this message clutters their UI.
Let's just move this debug.
Test Plan: yolo
Reviewers: kulshrax, #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4614036
Signature: t1:4614036:1487986024:6945b057aae62fc7a9fded9474d47ba134496e5a
Summary:
The current code checks if the filter error reports a rev number, and if it does
tries to convert it to a node. If the 'number' is actually just a short form of
a hash that happens to be all digits, then it may be a number greater than the
size of the changelog, so we need to not attempt to access it in the changelog,
otherwise we get an IndexError.
Test Plan: Added a test, it failed before with a weird error
Reviewers: #mercurial, kulshrax
Reviewed By: kulshrax
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4613988
Signature: t1:4613988:1488027938:4f5ffcb07aeecbaf59cad20fb3a592dd92ed2beb
Summary:
`mercurial.revset` was recently split into `revset + revsetlang + smartset`.
Update our code accordingly.
D4604848 has fixed the `revsetlang` part. This patch fixes the remaining
`smartset` part.
Also fixes some test failures introduced by D4547080.
Test Plan: `arc unit`
Reviewers: #mercurial
Subscribers: jeroenv, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4595417
Summary: creating a mercurial extension so that `hg record` functionality can be used via a text editor (instead of interactive command prompt or curses menu)
Test Plan: `$ run-tests.py test-edrecord.t`
Reviewers: durham, skreyen, most, #sourcecontrol, asriram, simonfar
Reviewed By: simonfar
Subscribers: quark, rmcelroy, simonfar, mjpieters, #nuclide
Differential Revision: https://phabricator.intern.facebook.com/D4547080
Tasks: 15728734
Signature: t1:4547080:1487842609:8855e35010cac3b6d2b136a80d7effa369eb1da8
Summary: The data was being sent to scuba, but then ignored altogether. Turn this into a single string instead.
Test Plan: arc unit
Reviewers: #sourcecontrol, andrasbelo
Reviewed By: andrasbelo
Subscribers: mjpieters, andrasbelo
Differential Revision: https://phabricator.intern.facebook.com/D4598196
Signature: t1:4598196:1487784582:8952e0e386325d1635029aab2b9d97e9284376ea
Summary:
Let's add a script that can be used as a commit hook to prevent bad commit
messages from happenning.
Test Plan:
Run the following perl script:
system("echo 1 >> 1");
system("hg add 1");
system("hg ci -m"."\x80");
system("hg ci -m"."\x01");
system("hg ci -m ok");
Output:
fbcode/1 already tracked!
transaction abort!
rollback completed
abort: decoding near '': 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte!
non-printable characters in commit message
transaction abort!
rollback completed
abort: pretxncommit hook failed
Make sure that commit is made with "ok" message, but there are no commits with
bad commit messages
Reviewers: #sourcecontrol, tja
Reviewed By: tja
Subscribers: tja, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4597432
Tasks: 16212973
Signature: t1:4597432:1487761552:cf38eabf93374b0ec2feb653dd70033de25e6e0e
Summary:
The profiling extension is to log interactive time.
The upstream change 459366b580cf breaks the profiling extension as it could
no longer wrap `maybeprofile` in time. And @simonfar's
`ui.timeblockedsection` is going to be a superior solution. So just remove
the profiling extension and its tests.
Test Plan: Checked that the extension is not enabled in our config files.
Reviewers: simonfar, #mercurial
Subscribers: mjpieters, simonfar
Differential Revision: https://phabricator.intern.facebook.com/D4583087
Summary:
97d0be4019ac in core broke the fastlog extension for multi-path
queries. We did not have a test to catch it. It was reported as broken by a
user.
Test Plan:
```
$ ../../hg/tests/run-tests.py test-fastlog.t
```
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4579133
Tasks: 16154586
Summary:
This command will allow us to expose simple api to all automation checking
working copy parent. It's meant to be overridden by our wrapper to read the
dirsate directly without shelling out to hg (see D4454504 )
Test Plan: see tests
Reviewers: #mercurial, durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4454502
Signature: t1:4454502:1485441135:09902c6437a7af55dfa5c97e3165681de687231f
Summary:
fastpartialmatch index may be incorrect if fastpartialmatch extension was
disabled, then new commits were added and then fastpartialmatch was
enabled back. We need to detect this situation and rebuild the index in
this case.
One approach would be to use _handleinconsistentindex() function to mark index
as invalid. There are a couple of drawbacks to this approach:
1) It requires more significant code changes
2) The output may still be incorrect if hash with the same prefix was added while fastpartialmatch was disabled.
Another approach would be to use header version from index files
(see class _header). That's even worse because we'll need to bump index
version in the code whenever we disable fastpartialmatch.
Third approach would be to use changelog mtime + size as a validation key but
then we need to ensure partialmatch index is written after changelog.
Instead I suggest to use generation numbers. It's just a number in the config
and in the special file inside partialmatch index directory. If the
two doesn't match then index is incorrect and needs to be deleted. The biggest
drawback to this approach is that we need to bump generation number each time
the extension is enabled. I think it should be fine because the one who enables
extensions usually understands it and he or she will bump the generation number.
Test Plan: arc unit
Reviewers: #sourcecontrol, durham, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4571926
Signature: t1:4571926:1487263035:53419c9ca4e344127f391ac19c1071a826fea3f1
Summary:
User reported failures because revlog.opener doesn't have `exists` function.
The reason is that sometimes opener is wrapped inside the function.
Let's use _realopener instead
Test Plan: arc unit
Reviewers: #sourcecontrol, mjpieters
Reviewed By: mjpieters
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4571659
Signature: t1:4571659:1487267797:a950ab7c88d75573df64ec1964755c054307c7ea
Summary:
Don't let errors propagate out of the gitnode() revset. Always report errors
in gitnode() as a translation failure, rather than letting exceptions propagate
up and crash mercurial. The code was previously only catching internally
generated ConduitError exceptions, but it can also throw HttpError exceptions,
and the underlying httplib code can throw its own exceptions as well as
socket.error exceptions.
This also fixes the test code to use an ephemeral TCP port rather than assuming
port 8543 will always be available. Using a fixed TCP port in test code is a
very common way to cause bogus failures if the tests are run in parallel.
(For instance, testing multiple repositories in parallel on the same build
host.)
Test Plan:
Added unit tests that check the behavior when the server returns a 500 error,
and when the server refuses the connection entirely.
Reviewers: quark, durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: net-systems-diffs@fb.com, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4556871
Signature: t1:4556871:1487062142:b58d770d46c975d44933bec08cfce8acb25ff16b
Summary:
Previously, smartlog use `tip` as the fallback master, and prompts:
warning: there is no master changeset locally, try pulling from server
if master is `tip`.
That makes smartlog less friendly for external users. This patch removes the
prompt and changes the fallback master to the last public revision so it
works out-of-box.
Test Plan: `arc unit`
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4555346
Signature: t1:4555346:1487036530:35a5fa65d5419e7324d3203fa52de9a82b8132e3
Summary:
This diff makes the following modifications to the (former) `hiddenhash` extension:
- Makes the error messages configurable, allowing us to easily change the error messages in `facebook.rc`.
- Renames the extension to `hiddenerror`, since the primary feature is now the configurable error messages rather than using a hash in the message.
- Changes the method by which the extension wraps the `changectx` constructor. The old method of wrapping would result in errors in code paths that in `context.py` that performed `isinstance()` checks on contexts.
Test Plan: To test arc patch this extension into your `facebook-hg-rpms` and enable it for a test repo. Then, attempt to access a hidden node. You should see the default error message defined in the extension. Setting `hiddenerror.message` and `hiddenerror.hint` should allow you to customize the messages. See test file for examples.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4548140
Tasks: 15896355
Signature: t1:4548140:1487063552:06395c1eaaa83b00ead8e80e2cd8f9d13f7d08e2
Summary: Sometimes you want to be able to justify why a line is in a sparse profile. Support empty lines and comments (starting with a hash).
Test Plan: Run the test runner
Reviewers: #mercurial, rmcelroy, durham
Reviewed By: durham
Differential Revision: https://phabricator.intern.facebook.com/D4537617
Tasks: 15993301
Signature: t1:4537617:1486687441:18a00b65df244b573bab095809fb1fbb57e21d71
Summary: If `hg debuginhibit` is run with no arguments, print out a list of inhibited nodes. This is similar to how `hg debugobsolete` works and will assist with debugging.
Test Plan: Run `hg debuginhibit` in a repo with inhibited nodes. (This can be tested by either stripping some test commits and then updating back to them, or by manually inhibiting the commits with `hg debuginhibit`.) A list of inhibited nodes should be printed. See test file for an example.
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D4541514
Tasks: 16004717
Signature: t1:4541514:1486722366:10b4232830ed88931bd6ac610972114743797192
Revert Plan:
Summary:
To get rid of this DeprecationWarning:
--- /data/hgbuild/facebook-hg-rpms/fb-hgext/tests/test-hiddenhash.t
+++ /data/hgbuild/facebook-hg-rpms/fb-hgext/tests/test-hiddenhash.t.err
@@ -10,5 +10,7 @@
$ hg debugbuilddag +1
$ hg debugobsolete 1ea73414a91b0920940797d8fc6a11e447f8ea1e
$ hg log -r 0
+ $TESTTMP/hiddenhash.py:33: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
+ match = re.match(r"hidden revision '(\d+)'", e.message)
abort: hidden changeset 1ea73414a91b!
[255]
let's not access `.message` and use str(e) instead
Test Plan:
arc unit,
Will test on centos6 soon
Reviewers: #sourcecontrol, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4521398
Signature: t1:4521398:1486470861:e39e4639346d0f1f2e4a69fc38ccf34fbc432df6
Summary:
HG_SAMPLING_FILEPATH was renamed to SCM_SAMPLING_FILEPATH long time ago.
Let's update the comment
Test Plan: Not tested
Reviewers: #sourcecontrol, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4507708
Signature: t1:4507708:1486141731:8a96ac74006cf9d240ad4cbbff928fe49fe71cb3
Summary:
Previously, when a command tried to access a hidden revision without the `--hidden` flag, the user would get the following error:
```
abort: hidden revision '0'!
(use --hidden to access hidden revisions)
```
With this extension, the error is now:
```
abort: hidden commit b8144197c244!
```
This way, novice users aren't tempted to immediately re-run the command with `--hidden`, which may have undesired results. It also makes it much easier to find the commit in question in `hg sl --hidden` since by default smartlog does not show rev numbers.
Test Plan: Attempt to access a hidden commit, observe new error message as seen above. Note that in the test file the word "changeset" is present instead of "commit" due to the lack of the `dialect` extension in the test.
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4506065
Tasks: 15747879
Signature: t1:4506065:1486122372:d82ebd488a00d1958c235f733a9455111954c116
Summary:
turned out that transaction can be None in some cases.
Let's just write to the cache in this case.
Test Plan: arc unit
Reviewers: #sourcecontrol, durham, andrasbelo
Reviewed By: andrasbelo
Subscribers: andrasbelo, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4507653
Tasks: 15862906
Signature: t1:4507653:1486133933:de0997ef1724ba1082c3597ea64aab760f670b47
Summary:
Recently @rmcelroy discovered that attempting to rebase a single commit in the middle of a stack results in the rest of the stack being marked as unstable. See https://fb.facebook.com/groups/sourcecontrol/permalink/1207767375939547/ for full example.
It turns out that the inhibit extension's post-transaction hook that would ordinarily inhibit the rebased (and thus obsolete) commit, and thereby hide the instability, was not firing in this case. This was similar to a previous problem with `hg next --rebase` wherein `--continue`'ing a rebase with conflicts would result in visible instability for the same reason. In both cases, the problem appears to be that `rebase` doesn't actually create a transaction, so of course the post-transaction hook doesn't fire.
The solution for `hg next --rebase` was to add a (nearly) empty transaction after the rebase call to trigger the hook. This diff just makes this the default behavior for `hg rebase` so that the hook is always called.
Test Plan:
See new test file. Basically, create a situation like:
```
o e5d56d debugbuilddag
| r3
|
| o c175ba debugbuilddag
| | r2
| |
| o 220949 debugbuilddag
|/ r1
|
o 1ad88b debugbuilddag
r0
```
Perform `hg rebase -r 1 -d 3`, which rebases commit "r1" onto "r3", which would ordinarily make "r2" unstable. Instead, the result should be as below, with no visible instability because "r1" is inhibited.
```
o 738e8e debugbuilddag
| r1
|
o e5d56d debugbuilddag
| r3
|
| o c175ba debugbuilddag
| | r2
| |
| x 220949 (Rebased as 738e8e) debugbuilddag
|/ r1
|
o 1ad88b debugbuilddag
r0
```
Reviewers: rmcelroy, #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters, rmcelroy
Differential Revision: https://phabricator.intern.facebook.com/D4491870
Tasks: 15697758
Signature: t1:4491870:1486033128:45b8e9a72af1e88ab78484ddef47a788d1aca7b5
Summary: Sort the output to fix tests on different platforms
Test Plan: arc unit on mac
Reviewers: #sourcecontrol, simonfar, ikostia
Reviewed By: simonfar, ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4501449
Signature: t1:4501449:1486050577:3041dc3c3691f48e39a0e9e05b1f97954a6d88e2
Summary:
If we have too many unsorted entries then finding matching revisions is
slower. To fix it we will rebuild partial index from time to time.
_findcandidates function marks index as need-to-be-rebuilt if it notices
index file with too many unsorted entries. Then _changegrouphook rebuilds
the index.
Test Plan: arc unit
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4494617
Summary:
Since we have some of the nodes sorted we can now use bisect to quickly find
matching nodes.
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4494419
Summary:
Append header to each fast partial match index file. For now it contains
version number and number of sorted entries in the file.
File is ignored if version number from file is different.
Test Plan: arc unit
Reviewers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4488417
Summary:
We'll add bisect algorithm soon.
Let's sort the nodes first during index rebuilding
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4488263
Summary:
strip may change revision numbers of many nodes at once.
It's better to rebuild index in case of strip.
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4474710
Summary:
This hook builds index if it's not present and it appends new entries
from the changegroup.
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4474704
Summary: These two functions actually use fastpartial index to resolve revision for a node.
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4474658
Summary:
Add commit hook to append new entries to the index.
It uses the same transactions as revlogs.
Do not append entries if index is not built (i.e.
if _partialindex does not exist). This is to ensure that we either
have complete index or none at all. Besides next diff will add
hooks to build index after pull if it doesn't exist.
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4474654
Summary:
Index to make node partial match fast i. e. speed up matching of partial hashes like f9bbd5.
This is an initial diff and it doesn't add any useful functionality, just debug commands.
Storage format is simple. There are a few files (at most 256).
Each file contains entries:
<20-byte node hash><4 byte encoded rev>
Each entry represents a commit (node).
Name of the file is the first two letters of the hex node hash. Nodes with the
same first two letters go to the same file. Nodes are NOT sorted inside the file
to make appends of new nodes easier.
Partial index should always be correct i.e. it should contain only nodes that
are present in the repo (regardless of whether they are visible or not) and
rev numbers for nodes should be correct too.
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4474642
Summary: Add a new extension to assist with debugging issues with the inhibit extension. Adds the `hg debuginhibit` and `hg debugdeinhibit` commands to manually inhibit/deinhibit commits as well as config options to print out the nodes being inhibited and truncated stack traces of each call site. I mostly made this into an extension so that it would be easy to debug inhibit issues from any user by just asking them to run their command with the appropriate `--config` flag.
Test Plan: See test file. Enabling the `debuginhibit.printnodes` and `debuginhibit.printstack` functions should result in the relevant nodes and stack traces to be printed whenever nodes are inhibited and deinhibited.
Reviewers: durham, rmcelroy, #mercurial, mitrandir, simonfar
Reviewed By: simonfar
Subscribers: mitrandir, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4485659
Signature: t1:4485659:1485985964:e6920b67450942c706c9523e9df48b4093b26d69
Summary: Although the split and fold commands usually abort on error, in some cases they simply write to stderr and return a nonzero exit status. Previously, the wrappers in fbamend would expect failures to result in an abort, and therefore didn't return early. This resulted in restack errors when this was not the case -- notably in the case of folding a commit with itself. This diff fixes the problem by returning early on error.
Test Plan: Attempting to fold a commit with itself (i.e., `hg fold --exact . .`) fails with an error message instead of crashing.
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4493029
Tasks: 15704338
Signature: t1:4493029:1485986404:17186b47786cf79c735b33adbb19de79ac75a5be
Summary: Previously, if a user ran split or fold on commits with bookmarks on them, those bookmarks would remain on the original commit instead of the new split or folded commits. This behavior was unexpected and confusing because it meant the obsolete commit would remain visible and the user would be forced to manually move the bookmark. This change makes split and fold automatically move any bookmarks on the old commits onto the newly created commits.
Test Plan: Run `hg split` or `hg fold` on a commit or set of commits with one or more bookmarks, and observe that the bookmarks are updated to point to the newly created commits. See tests for examples.
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4490655
Tasks: 15595449
Signature: t1:4490655:1485986009:858f099d3f95c6a45fe8b119d4f8d376b87652b7
Summary:
In certain situations, like infinitepush, the noderev cache builders would try
to save a node that didn't exist in the repo. This caused an exception. Now we
check each node before we attempt to resolve it to a rev.
Test Plan: Added a test. It failed before, and passes now.
Reviewers: #mercurial, andrasbelo
Reviewed By: andrasbelo
Subscribers: andrasbelo, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4494848
Signature: t1:4494848:1485964835:986d4fe3e29404cac22e4acf7d88c3715fcb51b9
This is an import of a bugfix in upstream evolve by Martin.
As reported in the issue, "hg uncommit" would lose copy information of
the files that remained in the commit. The problem was simply that the
a dict of copies was iterated as "src, dst in copies.items()" where it
should have been "dst, src ...".
Summary:
Previously the noderev cache only covered the branchmap. These days remotenames
and phases are also doing a lot of node->rev look ups, so let's add them to the
noderev cache as well.
Test Plan:
Compared hg book before and after the change. Noticed a significant
perf increase.
Reviewers: #mercurial, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4487962
Signature: t1:4487962:1485871615:634d95f61e916d81440a0f440010912af5ae6a13
Summary: This is basically the same as `hg amend -i` but since allowunstable operates at the command function level we need to explicitly whitelist this command. Note that I've set the obsmarker metadata to "amend" so that commits affected will be marked as "Amended as XXX" in smartlog. I don't think any other `hg record` flags other than --amend create obsmarkers so this should be OK.
Test Plan: Run `hg record --amend` in the middle of a stack and observe that it works now.
Reviewers: durham, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, reedriley
Differential Revision: https://phabricator.intern.facebook.com/D4466338
Tasks: 15705764
Signature: t1:4466338:1485424744:442604ce2089298f0724c27025502a3602113401
Summary: There is no valid reason to run `hg restack --hidden` (and this will cause unexpected behavior) so disable it.
Test Plan: `hg restack --hidden` now aborts. Added check to unit test.
Reviewers: rmcelroy, #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4463934
Tasks: 15615216
Signature: t1:4463934:1485386049:9836ec970d7c3e11c7dfaed21aa0ce8b58013294
Summary: Following the replacement in core.
Test Plan: test-rage.t passes now
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4441823
Signature: t1:4441823:1484921100:b1c8e1c0aef1196b7a8009a919e6d1fa3e2eb06c
Summary: The template keyword for split was not producing output because obsmarkers with multiple successors were being filtered out.
Test Plan: Correct "Split into XXX, YYY" labels appear in smartlog. Tests have been added for all of the obsolescence-related smartlog template keywords.
Reviewers: #sourcecontrol, rmcelroy, durham
Reviewed By: durham
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4396453
Signature: t1:4396453:1484880307:bfdc60385e42fee169ff2f0ec4f85dd0747b55c9
Summary: Automatically rebase unstable commits left behind after a split or fold in the middle of a stack. Previously, users had to run `hg restack` to fix their stacks after the fact. This change also fixes the issue identified in t14560234 whereby the old stack (entirely obsolete) stack would be left visible after splitting or folding a head commit due to the inhibit extension not correctly deinhibiting the old stack.
Test Plan: Create a stack of commits and perform `hg split` or `hg fold` on a commit (or set of commits) that have descendants. After the operation these commits should be rebased, preserving the linearity of the stack. See unit tests for specific test cases.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4432833
Tasks: 14560234, 15266009
Signature: t1:4432833:1484880689:1e07e421c8871dfef8bd016454aaed5a88a4a7d1
Summary:
Many of the template keywords in our extensions were being registered
incorrectly, causing their help output to be rendered incorrectly in the
"hg help templates" output. The ones in smartlog.py were particularly bad, as
most of them showed only their description, without displaying the name of the
template. In smartlog.py only singlepublicsuccessor was being displayed
correctly, because it's docstring explicitly included it's own name at the
start.
This fixes all of our extensions to consistently use the
registrar.templatekeyword() decorator to register the keywords. This decorator
automatically prefixes the help message with the keyword name. The
mercurial/extensions.py code will explicitly check to see if an extension
contains an "templatekeyword" attribute, and if so it will register any
keywords contained in this registry after calling extsetup().
Test Plan:
Added new unit tests to check the output of "hg help templates" for the
affected keywords.
Reviewers: #sourcecontrol, kulshrax, ikostia, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, net-systems-diffs@, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4427729
Signature: t1:4427729:1484831476:17b478a5e867dfc3f85402588c381bf8b1831107
Summary: Let people put #, t, commas or no, etc!
Test Plan: existing and new tests
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: durham, mjpieters, ullrich
Differential Revision: https://phabricator.intern.facebook.com/D4411027
Tasks: 15467918
Signature: t1:4411027:1484264937:cdc2452ac3ba920c153d3e0317972433da188a8e
Summary:
The remotenames extension automatically adds a --dest option to `hg rebase`, which causes
restack to abort. Instead, we should just drop the 'dest' key and proceed.
Test Plan: Attempt to use `hg rebase --restack` in fbsource when the current bookmark is tracking a remote bookmark.
Reviewers: #mercurial, durham, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4399846
Tasks: 15422257
Signature: t1:4399846:1484084585:4a6ec907032e7d8b1388980870b6d72cb560829f
Summary: Upstream Mercurial now has native support for statprof, rendering this file useless.
Test Plan: Remove statprofext.py* from my installed hg, confirm it still works. Build fb-hgext and run tests, confirm no new failures
Reviewers: #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4397926
Signature: t1:4397926:1484066120:0c1469d838a91a65fb57ecc858675256087e2c48
Summary: Added some tests for this also
Test Plan: arc unit in fb-hgext
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4397881
Tasks: 15360841
Signature: t1:4397881:1484066348:1b9fb24a30a9962de0dad858f4d57956a2c91dc4
Summary: To encourage people to learn about and use `hg restack` (which is a more general fixup tool), tell users about it instead of `hg amend --fixup`. I wasn't sure whether to advertise it as `hg rebase --restack` or just `hg restack`, so I've included both.
Test Plan: Do an amend in the middle of a stack and observe the new wording. Unit tests reflect changed wording.
Reviewers: durham, #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4390111
Signature: t1:4390111:1483962208:46951c8f5e4c499840b0b4b0ee8ac1e1b6c14ca9
Summary:
I got the following profile results when profiling smartlog:
{P56936293}
It suggests that regex compiling takes too much time. I tend to think that
profiling is inaccurate in this case because with this diff I didn't get any
noticable speed up. But this diff won't do any harm.
Test Plan: arc unit
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4387265
Signature: t1:4387265:1483724595:43de3c694109be2d4343d8ebdbc7ab79aa9edb04
The sshaskpass is not only a mercurial extension, but also a script that
runs separately, in which case it cannot import mercurial modules. So let's
fallback to os.environ.
Summary:
Without `--clean`, the user may not be able to abort cleanly.
Also, change "erase" to "discard" to be more consistent with the official
language. "changed" is replaced by "changes" as it looks like a grammar
mistake.
Test Plan: Updated existing tests
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4377376
Signature: t1:4377376:1483464655:f695fd643509d7fabb88298bd1004727ee64ef76
Summary: bundle file should be closed to ensure that all the temporary files were deleted
Test Plan: arc unit
Reviewers: #sourcecontrol, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4377148
Signature: t1:4377148:1483451990:2a1362d9e524a54ffedad8f2bc09fc622efe8ad4
Summary:
test-check-code.t was updated in core mercurial so we have to fix it in
fb-hgext
Test Plan: arc unit
Reviewers: #sourcecontrol, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4377208
Signature: t1:4377208:1483451688:bc382cdab07c6d6127d67c902458a2ccfa1373d1
Summary: The --limit option was carried over from the option list for `hg log`. However, it doesn't do anything in smartlog, so this diff removes it from the option list.
Test Plan: `hg smartlog --help` no longer shows `--limit`.
Reviewers: #mercurial
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4363187
Tasks: 15186221
Summary:
Make adding a set of rules efficient.
Currently buck autosparse writes directly to .hg/sparse, clobbering any
existing manual rules or profile settings. This is not optimal.
The command-line of hg sparse is too limited at the moment to add rules in any
other way (only one new rule per call!). The --import-rules option lets us
bulk-import and efficiently decide wether or not a refresh is needed.
Test Plan: arc unit
Reviewers: #sourcecontrol, andrasbelo
Reviewed By: andrasbelo
Subscribers: andrasbelo, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4358087
Signature: t1:4358087:1482409901:42b2d32dc624579a3d35875ba1bb126d9539cc69
Summary: Log active profiles for any command that uses the repository.
Test Plan: arc unit
Reviewers: #sourcecontrol, mitrandir
Reviewed By: mitrandir
Subscribers: andrasbelo, mitrandir, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4346795
Signature: t1:4346795:1482251224:a9b3568eeb7e57c61273ce0dc9f4d41abcd2888e
When installed into a path like /usr/lib/python2.7/dist-packages, this file
conflicts with the hgext3rd/__init__.py from mercurial itself. Let's keep the
mercurial version the canonical one, and just skip packaging this one.
I added a warning to this repo's __init__.py about behavior divergences between
this __init__.py and mercurial's version.
Summary:
Logging dirstate sizes gives us a way to track sparse profile use; how big a
working copy do people actually have?
The logged info can be directed to Scuba via the sampling extension.
Test Plan: Run on a local test repo with the debugger attached. Goal
Reviewers: #sourcecontrol, quark
Reviewed By: quark
Subscribers: mitrandir, quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4340367
Signature: t1:4340367:1481920819:d7358e0bdc2cc1422b36266374344e7d2b644ae5
Summary:
Previously, if during a pushrebaes a merge commit was rebased and the
parent commit that contained the original rebase destinations content (i.e.
master's content) was on the p2 side, it would all be thrown away.
This is because the pushrebase commit works by copying the destination-repo-p1, then
applying changes from the diff of the original-repo-p1 vs original-repo-commit.
Since all the rebase destination contents was in destination-repo-p2, it is all
lost here.
The solution is to track which commit is the latest one to contain the
destination bookmark contents, and make sure it is always p1 when rebasing merge
commits. This will ensure that the destination bookmark contents are preserved
all the way up to the new commit for that bookmark.
Test Plan:
Added a test. It fails before the change and passes after. Another
test was also affected, since the p1/p2 ordering is different.
Reviewers: #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4336427
Tasks: 15092414
Signature: t1:4336427:1481881555:a22b8c363f2f7a197cef192abf34bfca926ecdc2
Summary: Move the enabling of unstable changesets from fbamend to allowunstable, keeping all of the wrapping in one place.
Test Plan: Unit test still passes. No change in functionality.
Reviewers: #sourcecontrol, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4288233
Signature: t1:4288233:1481073858:a7432a9941e93fcadf5ad6502630a49c4e1207f7
Summary: This change enables "allowunstable" for the `hg rebase` command, which lets it create unstable changesets without full evolution enabled.
Test Plan: Create a stack of commits and attempt to rebase a commit in the middle of the stack, using a command like `hg rebase -r REV1 -d REV2` without the `--keep` flag. This will now work, and the old version of the rebased commit (with descendants) will render as an X in smartlog.
Reviewers: #sourcecontrol, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4287989
Signature: t1:4287989:1481074215:80103f6bfd150e51cc152bc257146d3f9369b175
Summary:
An extension to pre-fill your commit template based on your own
previous commit. Useful for stacked diffs where the commits are mostly related
and will have mostly the same reviewers, tasks, etc.
Test Plan: dogfooding + tests
Reviewers: #sourcecontrol, mjpieters, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4265616
Tasks: 12218809
Signature: t1:4265616:1480946835:ed18fadbd9068f2d2ec4799fa1ac176132b41e4b
Summary:
This patch changes docstring to make it clearer about how to use the
extensions. It provides some possibly useful details.
Besides, update `testedwith` to be consistent with other extensions.
Test Plan: My vim spellchecker seems happy.
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4263123
Signature: t1:4263123:1480668147:d042e9b52d0a2759ac360c87a2c87d2d3b0aa0f9
Summary:
This fixes test-check-config-hg.t for tweakdefaults. And did some clean-up
for other minor issues.
I was trying to implement another feature (along with the clean-up) in
tweakdefaults and finally realized it's infeasible and drop the feature. But
the clean-up seems useful thus sent here.
Also change `cp -r` to `cp -R` to pass the usptream check-code test.
Test Plan: `arc unit`
Reviewers: #sourcecontrol, mitrandir
Reviewed By: mitrandir
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4253852
Signature: t1:4253852:1480613350:398e9b234fcc2360dcb8a3e3ad4e5bc5c4377857
Test Plan:
Without this change, running `hg commit` in Eden was failing with the following:
```
AttributeError: 'shallowrepository' object has no attribute 'getsparsepatterns'
```
This is because our Eden mount is *shallow*, but not *sparse*, and
`shallowrepository` has a `sparsematch` method, so it yielded a false positive
for this check in `sparse.py`:
```
if util.safehasattr(repo, 'sparsematch'):
```
Because the first thing that is called after this check is:
```
_, _, profiles = repo.getsparsepatterns(ctx.rev())
```
it seems more appropriate to test for the `getsparsepatterns` attribute, anyway.
Reviewers: simpkins, durham
Differential Revision: https://phabricator.intern.facebook.com/D4248940
Summary: In my rush to get the allowunstable extension landed before the holidays, I made several embarrassing typos in the doc comment at the top of the extension. This diff fixes the typos and makes the comment more clear.
Test Plan: The only change was in a comment, so this is a no-op. Unit tests still pass for good measure.
Reviewers: durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4242510
Signature: t1:4242510:1480399263:a9822b5e762f1a94c322b15c2ddec9c1acb7df78
Summary:
Using `testedwith = 'internal'` is not a good habit [1]. Having it
auto-updated in batch would also introduce a lot of churn. This diff makes
them "ships-with-fb-hgext". If we do want to fill the ideal "testedwith"
information, we could put it in a centric place, like a "fbtestedwith"
extension rewriting those "ships-with-fb-hgext" on the fly.
Maybe having in-repo tags for tested Mercurial releases is also a good idea.
[1]: www.mercurial-scm.org/repo/hg/rev/2af1014c2534
Test Plan: `arc lint`
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4244689
Signature: t1:4244689:1480440027:3dc18d017b48beba1176fbfd120351889259eb4b
Summary:
Template lacks of the "padding" feature. There is a hard-coded 13-char wide
username, 5-char wide line number, which does not look well if the usernames
are too long or too short.
This patch restores the original annotate format which is different from
the current behavior. For example, given "-uc", it shows "user node" instead
of "node:user". It also tries to make the template version as close as the
non-template one, by adjusting the order, changing separators, and making
"-c" optional (could be hidden from the output).
Test Plan: Modified existing tests
Reviewers: #sourcecontrol, ikostia
Reviewed By: ikostia
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4243830
Signature: t1:4243830:1480437984:1c679c9db516bab905d027061326a7a1524922c6
Summary: Currently, the reason we can't perform operations such as histedit, split, and fold in the middle of a stack is that we do not have the experimental.evolution=allowunstable option enabled. It turns out all of these commands will do the "right thing" if this option is enabled. However, since we are uncertain of the ramifications of enabling this option globally, this new extension turns the option on for the duration of split, fold, and histedit, allowing those commands to be used in the middle of a stack without config changes.
Test Plan: See unit tests. Basically, create a stack and then attempt to use split, fold, or histedit somewhere in the middle.
Reviewers: #mercurial, durham
Reviewed By: durham
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4209315
Tasks: 14598405
Signature: t1:4209315:1479744780:811e8bef02149a055376c0f105ac2d389dd60970
Summary: Add template keywords for split, folded, and histedited successors. This will enable us to show "(Histedited as XXX)" annotations in smartlog.
Test Plan: By itself this should be a no-op. All unit tests still pass. The effects of this aren't visible unless a user uses a version of our facebook.rc config file that contains updated smartlog templates. See D4209113.
Reviewers: durham
Reviewed By: durham
Subscribers: mjpieters, #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D4209314
Signature: t1:4209314:1479744837:8eeeeb7a031abfabeb302abde9e4b1f3d789a479
Summary:
I'm going to use runshellfast in infinitepush.
To avoid copy-paste let's move it to the separate package.
Note: fastmanifest also has runshellfast but it's implementation
is a bit different and seems that it doesn't work with remotefilelog.
So I'll leave it alone for now.
Test Plan: python run-tests.py -j20
Reviewers: #sourcecontrol
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4175836
Summary:
Upstream has refactored the manifest to be a manifestlog, so we need to update
our usage of it accordingly.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4180889
Signature: t1:4180889:1479228547:378f91b556493e05ff0222449b43cf498c301467
Summary:
Upstream has refactored the manifest class, so we need to update pushrebase to
work with the new structure. In particular, pushrebase takes advantage of the
manifest cache, so we need to carefully reconstruct the appropriate cache on the
bundle repo. We can't just .copy() it now because the cache contains manifestctx
instead of manifestdict, and the manifestctx contains a reference to the source
repo.
Test Plan: Ran the tests
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4180885
Signature: t1:4180885:1479228506:a0ff114e158caab25da22f6116e5a4090f5515c0
Summary: Remove the old _nextrebase() function. This function is no longer used after the updates to `hg previous` and `hg next`.
Test Plan: All unit tests pass. This code is not called anywhere so removing it should be a no-op.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4121784
Tasks: 14119420
Signature: t1:4121784:1478305767:15a737545d0e85c175018e190cb92f722ebad7d8
Summary:
This diff replaces the `hg previous` and `hg next` commands from the evolve extension with new implementations. The new commands have several features not found in evolve:
- Users can now move by multiple commits at a time. Example: `hg next 3`
- Users can move all the way to the top or bottom of the current stack with the following new flags: `hg next --top` and `hg prev --bottom`
- Users can rebase child commits on demand with `hg next --rebase`. This flag can be combined with the others to specify exactly how many commits to rebase. Example: `hg next --rebase 4` (move 4 commits up the stack, rebasing as needed) `hg next --rebase --top` (rebase all the way to the top of the stack)
- When a user lands on a particular commit, if there is a bookmark it will be automatically activated. The user can also move to the previous or next commit with a bookmark with the `--bookmark` flag.
- The user can pass the `--newest` flag to resolve ambiguity in situations where history is nonlinear. With the flag the command will always choose the commit with the higher rev number at each step.
- The commands now show commit hashes instead of rev numbers when showing the user what commit they landed on.
Apologies in advance for the large diff. I've tried splitting it up as best as I could, but the unit tests introduced here significantly increase the size. I figured the unit tests should be part of this diff instead of being added in a separate one. This diff is almost entirely new code, so I hope that helps a little bit. Let me know if there's a better way to split this up.
Test Plan: See the new unit tests for an extensive look at the new commands in action. Essentially, all of the features mentioned above should work as expected.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4121778
Tasks: 14119420
Signature: t1:4121778:1478774243:a7131593222bc329f541e77e1d3ebd8222e47e79
Summary: The new `hg next` and `hg previous` implementations rely on the inhibit extension to inhibit visible obsolete changesets, thereby preventing unstable descendants from appearing as "unstable" in smartlog for end users. The inhibit extension does this by registering a callback that runs whenever a transaction closes. However, it turns out that this callback isn't being called at the end of a rebase, so we need to add a transaction to call it ourselves.
Test Plan: All unit tests for fbamend still pass. Currently, there isn't a way to demonstrate the issue that occurs if this code isn't here; the new `hg previous` and `hg next` functions introduced in the next diff in this stack do provide a unit test to check for this behavior.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4121768
Tasks: 14119420
Signature: t1:4121768:1479264251:841bd6473df810e3d663550ef48ec6948476f3a2
Summary:
Wrap `_adjustlinkrev` so it first tries the possibly faster path (linkrev
database). Then fallback to the original linkrev algorithm.
Also fixes an issue that `{k : v ...}` syntax does not work in Python 2.6.
Test Plan: Added a very simple test
Reviewers: #sourcecontrol, durham
Reviewed By: durham
Subscribers: durham, stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4143315
Signature: t1:4143315:1479234110:07e87c7584e0cfd627b3f9e2fae1a2a34beb390f
Summary: Allow for any number of spaces after the colon
Test Plan: arc unit
Reviewers: #sourcecontrol
Subscribers: markisaa
Differential Revision: https://phabricator.intern.facebook.com/D4179619
Tasks: 14532985
Summary:
Adds a `debugverifylinkrevcache` to verify the linkrevs in the database,
against the vanilla adjustlinkrev algorithm.
Test Plan: A simple test is added. The code is also manually tested on my hg repo.
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4143240
Signature: t1:4143240:1479217639:bb9b5814b405b9e60a0722b01fc2c918c5a24b35
Summary:
This diff implements a `debugbuildlinkrevcache` command which builds the
linkrev database.
Test Plan: A simple test will be added when the cache can be verified.
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: stash, jsgf, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4143200
Signature: t1:4143200:1479131313:858042c86b5894898333900f63ea0cd50c47e934
Summary: This diff makes the linkrev database accessible via `repo._linkrevcache`.
Test Plan: A test will be added when the feature is more complete.
Reviewers: #sourcecontrol, jeroenv
Reviewed By: jeroenv
Subscribers: jeroenv, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4143175
Signature: t1:4143175:1478558825:2c0eb0fa0f77cf004aee7c40ffc2a6ea417f6212
Summary:
This diff implements some simple linkrev database classes which uses dbm to
store linkrev candidates.
Why not sqlite? sqlite's insertion seems to be much slower with index being
present, so we have to do manual buffering and do insertion in batch, not to
say parsing SQL itself can introduce overhead. If we really want sqlite for
some reason (i.e. its support for concurrent writer and reader seems to be
better), we can still implement it as a dbm engine.
Test Plan: A test will be added when there is something usable.
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: jsgf, stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4143119
Signature: t1:4143119:1479131795:5f6e368ebd1798b874cec28ac05b137eb3bea86e
Summary:
Previously, `hg rebase --restack` would find the closest stable base commit with unstable descendants on its precursors, and begin the restack operation from this commit. What this meant is that it would not resolve all instability in the current stack -- only instability above the first instance of instability detected by searching downward from the current changeset.
Given that we will soon be able to perform local fixup operations with something like `hg next --rebase --top`, it no longer makes sense to keep `hg rebase --restack` as a local operation. Instead, it should resolve all instability in the current stack. This diff changes the behavior to always begin restacking from the bottom of the stack.
One thing to note about this diff is that it completely removes divergence detection from restack. This is because in the process of making this change, I discovered a bug in the original version of restack whereby divergence would only be detected if it involved a precursor of the base changeset. This is because the check was only happening in _latest(), which after several rounds of changes to this code, was only being used in _findstablebase(). In all other cases, the implicit behavior was that unstable children are rebased onto the newest visible successor of their parent, as determined by rev number.
It turns out that altering this behavior to skip rebasing unstable descendants of divergent changesets is nontrivial, and furthermore, one could argue that the current behavior is actually desirable. (Furthermore, this change removes the O(n^2) behavior from _latest().) Regardless of whether it is desirable or not, this diff makes that implicit behavior explicit, and modifies the tests to explicitly check for the new behavior. If we do decide to skip divergent changesets, this will need to happen in another diff as it will require some restructuring of the restack target finding logic.
Test Plan:
See unit tests.
1. Create a stack of commits.
2. Pick several commits in the stack, and amend them without the `--rebase` flag, thereby leaving their respective descendants unrebased.
3. Update to the top of the stack.
4. Run `hg rebase --restack`. All instability will be resolved.
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4144899
Tasks: 14041544
Signature: t1:4144899:1478781779:1a94dbc1c6b69d7116f1d40593a83684ed44942a
Summary: Add some miscellaneous new helper functions that will be used in the new implementation of `hg previous` and `hg next`. These are just utility functions for things like setting bookmarks, printing out changeset lists, and hiding command line options. Also fixed a few typos in comments.
Test Plan: All tests still pass. This change should be a no-op as these functions are not called anywhere.
Reviewers: durham, quark, #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4121764
Tasks: 14119420
Signature: t1:4121764:1478162841:32362fef3727e67e46b5700d9242be5c0cd62a52
Summary: Do a minor refactor and rename of some of the wrapper functions in this file. There are no functional changes. These names were chosen to follow a consistent convention and be less confusing when taken together with the new `hg previous` and `hg next` functions that will be added in a later diff.
Test Plan: All tests still pass.
Reviewers: durham, quark, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4121755
Tasks: 14119420
Signature: t1:4121755:1478164041:d8c603c32554d1d7c1df9706386c015f90ad62c6
Summary:
The old code didn't test if the new commit will become empty correctly, if its
"memworkingcopy" contains changes inherited from its parent. This diff fixes
the problem.
Thanks @stash for discovering the issue!
Test Plan: Added a test case for this issue. Make sure the old code cannot pass.
Reviewers: #mercurial, stash
Reviewed By: stash
Subscribers: mjpieters, stash
Differential Revision: https://phabricator.intern.facebook.com/D4113438
Signature: t1:4113438:1478077373:194104b902bdfe6827858c2916a7f3f0cd83ee6c
Summary:
The fake node has an illegal revision number that cannot be used in the
`allsuccessors` revset.
Test Plan: It should work in theory. I couldn't construct a testcase relatively quickly.
Reviewers: #sourcecontrol, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4082186
Signature: t1:4082186:1477503381:ac646071af5ad0e63a83ca7199e62a75ef736bce
Summary: Make nodes with visible successors render as 'x' in hg smartlog output. Previously these nodes were rendered as 'o' because the inhibit extension made them appear to be non-obsolete.
Test Plan:
1. Create a stack of commits.
2. Amend a commit in the middle of the stack.
3. Run `hg sl`, observe that although the precursor of the amended commit renders as an 'x'.
4. Run `hg unamend`, then update to a different commit (so the precursor is not the current commit and thus not rendered as '@').
5. Observe that the precursor now appears as 'o' again because it has no visible successors.
Reviewers: #sourcecontrol, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4071058
Tasks: 13652083
Signature: t1:4071058:1477434742:f57bf5a07b6b9497472deb8445f5fc01a5379f8c
Summary: Added a configuration option to make fbamend use the functionality from `hg rebase --restack` instead of the previous bookmark-based approach in `hg amend`.
Test Plan: Enable the `fbamend.userestack` config option and attempt to use `hg amend`, `hg amend --fixup`, and `hg amend --rebase`. These should all work just as before, except that `hg amend` will no longer create .preamend bookmarks.
Reviewers: #sourcecontrol, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4062925
Tasks: 13839177
Signature: t1:4062925:1477359251:0ece10599987d6b8e39384e9530866ffb2e50e58
Summary: `hg next --rebase` was not adding metadata to the obsolescence markers it manually creates (manual creation is necessary because of the --keep flag), which meant that `hg sl` output did not show "Rebased as XXX" annotations for commits rebased using this command. This change adds the metadata.
Test Plan:
1. Create a stack of commits.
2. Amend a commit that is at least 2 commits from the top of the stack. (This way rebasing this commit's child will not result in the entire old stack getting deinhibited.)
3. Run `hg next --rebase`.
4. Run `hg sl`, observe that the rebased child is annotated as "Rebased as XXX".
Reviewers: quark, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4060814
Tasks: 14027474
Signature: t1:4060814:1477094781:5bf0b2b42eafcb2267ff6821e33d5e8fe7059eb0
Summary: These variables were unused, causing test-check-pyflakes.t to fail whenever fbamend.py is modified in a way that changes the line numbers of those assignments.
Test Plan: Unit tests still pass (except test-fbamend.t, which fails for reasons unrelated to this change)
Reviewers: durham, #sourcecontrol, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4055599
Signature: t1:4055599:1477049676:84ec9a1036bb6d6873d497caed9feff701a8169b
Summary:
This diff was created when I was investigating hgamend exec not working
with histedit which resulted with [1].
This also brings some very small fixes for sqldirstate and fbamend that
I was too lazy to diff separately.
[1] https://patchwork.mercurial-scm.org/patch/16451/
Test Plan: ran tests
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3777784
Signature: t1:3777784:1472227075:f2f8a9cad22bf0c45d4554709846b8aafb61d9a0
Summary: Benchmarking `hg rebase --restack` against `hg evolve --all` showed that `hg rebase --restack` was spending a lot of time on a single revset to identify the current stack of commits. This diff changes the revset to an equivalent but more efficient one.
Test Plan:
All unit tests still pass.
For benchmarking, I created a stack of 4 commits on top of remote/master in fbsource/fbcode. I amended the second commit and then ran the command. Here is profiler output for both before and after the change:
Before (10.87 seconds): P56747821
After (7.58 seconds): P56747927
Based on the profiler output, this change results in a 30% performance improvement in this case.
Reviewers: durham, #sourcecontrol, quark
Reviewed By: quark
Subscribers: quark, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4038630
Tasks: 13976698
Signature: t1:4038630:1476825563:02da1d4e459f780de41d852f88da789513aba7dc
Summary:
The current `sshaskpass` implementation relies on `stdin` and `stderr` being
TTYs. That can not be guaranteed if pager is used. With chg enabled, the chg
client will call `attachio` when starting the pager, and it which will override
both `stdin` and `stderr` to the pipes created by the chg pager logic. This
causes failures when a paged command (like `hg diff`) needs interactive ssh
authentication (happens when remotefilelog cache misses).
This patch fixes it by backing up TTY fds inside the `sshaskpass` module. With
chg enabled, the first `attachio` (before starting pager) can provide TTY fds,
where we just back them up. The second `attachio` (after pager started) will
override `ui.fin/fout`, `sys.stdin/stdout` to non-tty fds but it does not matter
since we have backups.
Test Plan:
Run the following command in a remotefilelog repo:
```
rm /tmp/chg$UID /tmp/r -rf; chg diff --config remotefilelog.cachepath=/tmp/r --debug --pager=on
```
And confirm password prompt works as expected.
Reviewers: rmcelroy, #sourcecontrol, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D4032236
Signature: t1:4032236:1476755400:80fc6007b6fb2f9fe83cf6570d80a2b431fc069f
Summary:
A user ran into a bug where a failed rebase left their repository in a state
where "hg status" reported many excluded files had been removed.
They weren't able to recover from this state, even using "hg update --clean ."
This was because the sparse extension was ignoring the actions to forget these
files from the dirstate. The sparse extension should allow excluded files to
be forgotten.
Test Plan:
I tried writing a test case for this but wasn't able to figure out how to
trigger exactly the situation that the user's repository was in. (It looks
like there were other bugs in "hg rebase --abort" that led to their repository
state.)
I was able to cause some other problems with files in the "g" type
("remote created") that "hg update --clean" wouldn't fix. I haven't added
those test cases for now though, since that problem isnt' fixed by this diff.
It does seem like there are potentially other problems here that still need to
be addressed.
Reviewers: quark, rmcelroy, mjpieters, durham
Reviewed By: durham
Subscribers: net-systems-diffs@, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3966580
Tasks: 13694820
Signature: t1:3966580:1475676328:48433e203ae702a50b40176e52f1ed90a5c45504
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
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
Summary:
Fix the revsetdiff() function to always return a revision number.
Previously if the revision information was retreived from phabricator rather
than being found locally we return a changeset string rather than a revision
number. This fixes the code to convert the changeset string back to a revision
number. If the specified commit does not exist in the local repository, we
throw an error indicating that the user should run "hg pull"
Test Plan:
Tested running "hg graft -r DXXXXXXX" with a diff that was not present in the
local repository yet. Confirmed it now prints an error indicating that the
user needs to run "hg pull" to fetch this revision, whereas previously it
crashed with an "invalid literal for int()" error.
Reviewers: #sourcecontrol, durham, simonfar, quark
Reviewed By: quark
Subscribers: net-systems-diffs@, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3997925
Tasks: 11355408
Signature: t1:3997925:1476201895:9b5832dc28abdddaa281a848246476b78f5a9fe7
Summary:
fbamend.py has several unused imports. This is annoying since I'm actively working on this file.
This change removes and consolidates the imports.
Test Plan: All unit tests for this file (namely test-fbamend.py and test-fbamend-nextrebase.py) still pass.
Reviewers: #sourcecontrol, durham, quark, stash
Reviewed By: stash
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3965839
Signature: t1:3965839:1475573964:e7937ce7e7bc35655d629345156c4d177f185605
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
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
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
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
Summary:
The default template is more compact and more useful with thigns like remote
bookmarks included.
Also drop '--all' and add '--hidden' since recent commits are much more
interesting than old commits and recent hidden commits will be useful when
people have recently lost something.
Test Plan: run `hg rage`, look at paste produced
Reviewers: #mercurial, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3904646
Signature: t1:3904646:1475171650:fc1bab0062be39c590b61492bce42236f3bb6123
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
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
Summary:
Now that the graph module can draw "..." for grand parents, it's no longer
to have fake nodes for that purpose. Remove most fake node related logic.
This will make the output more compact.
Note that the fake node is still used for "indentnonpublic" and its output
is slightly changed to display an "o" node, which will be fixed in the next
diff.
Since we now rely on a recent version of mercurial, remove some "inspect"
check for ancient mercurial support.
Test Plan: Run the modified `test-smartlog.t` and other `test-smartlog*.t`.
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3880771
Signature: t1:3880771:1474306496:3400c70efbb569c5096e724720ead1992b87f160
Summary:
One thing that may confuse new users is that when draft changesets are on top
of public changesets:
```
o draft
|
o remote/master
```
It's unclear whether the draft changeset is already in the master branch, or not.
This diff adds an option to move the drafts to the second column to indicate they
are not part of master.
Test Plan: Run `test-smartlog.t`
Reviewers: ttung, durham, #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3876951
Signature: t1:3876951:1474043568:c97b26b49917f36a5197af93ea386658b91d56a4
Summary:
"changeset" is a more official term and let's use it. Note that this patch
only changes documentation / i18n messages visible to the users and header
comment blocks to developers. Other places like comments in the code are
untouched.
With the "dialect" extension enabled, users will still see the more friendly
term - "commit".
Test Plan:
`arc unit`. Note the remotefilelog failure is probably unrelated - seems
related to ongoing / upcoming manifest refactoring upstream.
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3900394
Signature: t1:3900394:1474470348:6a1b5691e2599cc47df18b227d56d1f9d3c7c906
Summary:
As discussed before, we think terms like "changeset" is more official to hg,
while less known as "commit" is used more widely.
This extension replaces "changeset" with "commit" so users will get a
consistent view about the term being used, and we can use "changeset" in our
code to be more official while don't need to worry about user friendliness.
Test Plan: Run the newly added test
Reviewers: #sourcecontrol, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3900240
Signature: t1:3900240:1474470482:44ac6e09d58e624c539bb1336842ce8911c9dcee
Summary:
We have seen issues that users have outdated groups when running hg commands,
which will probably always cause issues:
- Authentication issue, unable to ssh
- Filesystem permission issue, unable to write hgcache
- Even worse with chg server since the long-running server process will keep
the wrong groups information
This extension is to address the above issues. It allows us to print a message
to let the user know they have group issues. Besides, it allows us to override
configs like `chgserver.idletimeout` so chg servers with wrong groups can have
a much smaller TTL and won't be long-running and causing issues.
Test Plan: Run the newly added test
Reviewers: #sourcecontrol, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3896628
Signature: t1:3896628:1474454162:22785ff23e3ada75013ce5f1eead3407068ba172
Summary:
When diffing a with b, if a is empty, we don't insert a "dummyendline" (see
line 214) because we do not have the last line to copy. In this case, if an
insertion happens, we have no "nearbylinenums" (see line 274) to visit.
The current code assumes "nearbylinenums" have at least one element, which
is wrong in the above case and will crash the program.
The fix is to add a check about whether "annotated" (aka. "a") is empty or
not.
Test Plan: Run `test-absorb-filefixupstate.py`
Reviewers: #sourcecontrol, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3867686
Tasks: 13371265
Signature: t1:3867686:1474289020:a183e6837e6e0afb8a5d56641689e240e8cd78c9
Summary:
Add docstring so `hg help -e smartlog` works and the config options are more
visible to users.
Rename "commit" to "changeset" so it sounds more official in the hg community.
Test Plan: No logic change. Code Review
Reviewers: durham, #mercurial, ttung, mjpieters
Reviewed By: mjpieters
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3876938
Signature: t1:3876938:1474288105:cb751cc868e70761cf3b34749eabf2a32c886a2d
Summary:
This feature allows the user to choose what lines exist in what changesets
precisely, for example:
HG: editing a
HG: "y" means the line to the right exists in the changeset to the top
HG:
HG: /---- 991104c93ef1 commit 1
HG: |/--- aa7e21df9b0b commit 2
HG: ||/-- 05b39f5d9141 commit 3
HG: |||
yyy : 1
yy : 2
y : 3
The feature can be used to "move" lines among changesets, or generally
editing the contents in a new way. So it's not limited in the "absorb"
use-case. We may want to give it another name in the future.
Test Plan: Added a new test case
Reviewers: #mercurial, rmcelroy, ttung
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3841494
Signature: t1:3841494:1473769708:1bb2a46c010222438ceaae69ea0dca39e37581d2
Summary:
While on Linux, `ssh` prompts `username's password:`, the OS X uses
`Password:`. Change `_shoulddisableecho` to include that case.
Test Plan:
Run `chg push ssh://localhost//tmp/foo` on an OS X system and check echo
is disabled for the password prompt.
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3841947
Signature: t1:3841947:1473440175:ea2c171a4bfda9d00b4de8c7c51bb00d0b7194f1
Summary:
`chg` has some special handling on `ui.system` - if it is simple, it will
be forwarded to the client (the `chg` process) and the new process will be
a child of `chg`, which will inherit the controlling TTY correctly.
Otherwise, it will be a child of a server-side worker process, which does
not have a controlling TTY. That's the case if `util.system` is used.
Test Plan:
Insert `x sleep 1000` in the histedit plan and confirm the `sleep`
process runs as a child of the `chg` process:
```
41876 13176 pts/14 Ss 03:17 0:00 \_ zsh
4196 732 pts/14 S+ 03:20 0:00 | \_ chg histedit
7572 664 pts/14 S+ 03:20 0:00 | \_ sleep 1000
```
Reviewers: #mercurial, ttung, rmcelroy, simpkins
Reviewed By: simpkins
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3846243
Tasks: 13295639
Signature: t1:3846243:1473480297:59aaf34cb3a52200321122dc7c054e2454cd3bd3
Summary:
The upstream changed the signature of `verify` in 9ec9fba6ea06
(`histedit: move constraint verification to the 'action.verify' method`):
- def verify(self, prev):
+ def verify(self, prev, expected, seen):
The upstream also moves the check about `action.node` around so
they become required and we have to set `self.node` in our histedit actions.
Test Plan:
Run histedit with the latest (8a658b) upstream code. Use `x sleep 1` and
ensure it works.
Reviewers: #mercurial, ttung, ikostia
Reviewed By: ikostia
Subscribers: ikostia, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3846190
Signature: t1:3846190:1473671179:97b238748e99a5868bb84614b89360e750b529a4
Summary:
logginghelper extension returns full path to the repo instead of just repo name.
It makes it hard to aggregate results per repo in scuba.
Use just repo name instead of repo root.
We can get repo name either from `paths.default` config value or
a basename of the repo root.
Test Plan:
Before:
{P56637657}
After:
{P56637661}
Diff
{P56637665}
Reviewers: rmcelroy, ttung, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3827912
Signature: t1:3827912:1473413932:5c38ca48e58a080c97b35610ee8889d66b4d5ab3
Summary:
We are going to log many different pieces of information in this extensions.
Therefore the `reporootlog` is not an appropriate name anymore.
Change it to `logginghelper`.
Test Plan:
Note that repo root is still logged instead of repo name. It will be changed in subsequent diffs
{P56637657}
Reviewers: rmcelroy, quark, ttung
Reviewed By: ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3840985
Signature: t1:3840985:1473410718:62d83f008f2973b7ed5266b0a5ebf67fe54b48c4
Summary:
In upstream mercurial, 3d5e0fd41e0e changed discovery.outgoing() from taking a
changelog to taking the full repo object.
Test Plan: run tests, fewer stacktraces
Reviewers: #mercurial, ttung, durham, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3819300
Signature: t1:3819300:1473090807:fd0e4c2956fee4ad7d45051b6b7c5be481c766f1
getfile should return the file mode as (islink, isexec),
but it was returned as (islink, isbinary).
As a result, using 'hg absorb' removed executable mode from
the relevant changeset so the mode change showed up in the working directory.
Issue reported with test case by Thomas De Schampheleire.
Summary:
See http://bugs.python.org/issue27666 for details.
`win.box(0, 0)` will crash python if it is built with stack check / protection
(by using hardening-wrapper with `HARDENING_STACK_CHECK=1` and
`HARDENING_STACK_PROTECTOR=2`).
Test Plan: Run `hg chistedit tip` on Arch Linux, and it does not crash instantly.
Reviewers: #sourcecontrol, ttung, jeroenv
Reviewed By: jeroenv
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3806224
Signature: t1:3806224:1472758902:8a73645fd1ef98c9106c3b2766e368d4072a2d46
Summary:
The sshaskpass code is both an hg extension and a standalone python script.
In the latter case, it does not need to import mercurial packages (and
doing that may cause `ImportError` if `mercurial` is not in python path).
Test Plan:
Manually make the change in a Mac Mini device and check `chg pull` works
with ssh password authentication.
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3799653
Signature: t1:3799653:1472675282:9f7e9f4f29281db239f33cf396057ea12ff21773
You can jump to a patch by pressing its numeric index, but this obviously only works with up to 10 patches. Moreover, with a large number of patches the feature is dangerous, since an accidental number press will lose your place. While we could do something fancy and prompt for multi-digit input in the many-patch case, it doesn't seem worth the complexity, and simply disabling 'goto' seems good enough.
Summary:
This seems to be an elegant choice. It does not conflict with other names,
and it does explain the concept to some extent vividly.
Credit goes to [trousers at lobste.rs](https://lobste.rs/s/nws1uj/help_us_name_new_mercurial_feature/comments/u4tsw7#c_u4tsw7).
Test Plan: Run the existing tests.
Reviewers: #sourcecontrol, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3763992
Signature: t1:3763992:1472049269:5bb9de3b7b3a0f0dd9587b952151fc38351bc822
Summary:
Some people think this command should be a part of "amend". If you check the
meaning of the "amend" English word, that makes sense. But if you look at
the actual "amend" command, there are significant differences:
1. smartfixup rewrites a stack of changesets, and can even delete
changesets, where amend only rewrites the working directory parent.
2. smartfixup is best-effort, i.e. does not guarantee that 100% of
user-requested modifications will be included, where amend will just take
100% (with "-i", it's 100% chunks selected by the user).
3. a lot of "amend" flags do not make much sense to smartfixup, like message
editing (designed to edit a single changeset), "--addremove", "--secret",
etc.
4. literally, smartfixup shares little code with the existing "amend" logic.
"amend" is part of "fbamend" or "evolve". this extension should not
depend on any of them.
So it's cleaner to be a separate command, not a part of `amend`.
However, I think it makes sense to have an option to satisfy those who want
to use "amend". So they can use "amend --related", "amend --fixups",
"amend --stack", "amend --auto" or whatever they choose. This diff adds such
a config option. We may also ship such a config option to make the command
easier for discovery.
Note the "amend" version is slightly different from the original smartfixup
command. The former targets basic users who expect amend to take all of
their changes, while the latter targets power users understanding what's
going on.
Therefore, the "amend" version will print extra information about what
changes are ignored, for example:
```
# changes not applied and left in working directory:
# M a : 1 modified chunks were ignored
# M c : unsupported file type (ex. binary or link)
# R b : removed files were ignored
```
To support the above change, `fixupstate.status` was added to avoid a second
"status" run and handles the "status" with interactive mode correctly. An
issue about symbolic links being added to `fixupstate.paths` was fixed by
the way.
Test Plan: Run the newly changed test.
Reviewers: #sourcecontrol, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3760498
Signature: t1:3760498:1472052376:7ddbfe763c7327d044b0d471c31a58fcb1e21dac
Summary:
Sharing repo.changelog across threads is problematic in mercurial
since it may internally cache things, and clearing cache while another
thread is executing is not nice. In particular, code such as the following
is inherently raceful when sharing changelogs (or anything derived from
revlog) across threads:
if self._cache:
if self._cache[0] == node:
return self._cache[2]
cachedrev = self._cache[1]
Reworked things a bit to make sure the spawned threads have their own
newly created changelogs and member functions internally referencing them.
Test Plan:
No longer seeing random exceptions being thrown from local log
threads (which terminates iteration)
Reviewers: rmcelroy, #mercurial, ttung, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3733592
Tasks: 12341014
Signature: t1:3733592:1471908572:877b56241e56b6ea92c76023460d4fbe80a4263d
Summary:
The multi-path support is pretty shameful; we can
do much better by issuing multiple queries and combining
results. File support was also missing.
Test Plan:
Ran fastlog test. Need to update test to test files.
P56589012
Reviewers: quark, rmcelroy, durham
Reviewed By: durham
Subscribers: stash, mjpieters, jeroenv
Differential Revision: https://phabricator.intern.facebook.com/D3726318
Tasks: 12341014
Signature: t1:3726318:1471919354:e5e8f40a5b918b493e927c2d620da1fdefa1768c
Summary:
Bugfix - we were failing to check local patterns in the fastpath.
Pass a filtering function to the local log thread to limit its results.
Test Plan: Run local log
Reviewers: stash, quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3727573
Tasks: 12341014
Signature: t1:3727573:1471907418:37b83d6c02e61ce2705070c7a86dd815a1c1cb29
Summary: Without this, exceptions are super hard to debug
Test Plan: Manually force exceptions with bogus array indices on non-arrays
Reviewers: quark, #mercurial, ttung, durham
Reviewed By: durham
Subscribers: stash, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3744317
Tasks: 12341014
Signature: t1:3744317:1471919239:8c8d0fce6c212fd677df8b7f94a48d17dbe64b93
Summary:
Like `commit -i`, this diff adds an `interactive` mode. I'd like
to reuse some patching code but they are tightly coupled about
writing files to disk - while I want to handle everything in memory.
In the future I may want to add `memorystore` and `memorybackend`
to upstream's `patch.py`. But they are not available now therefore
the "patching" logic is a re-invent. Fortunately the logic is just
about 20 lines.
Test Plan:
Manually run `hg sf -i` with some manually crafted random cases.
Also make sure it works with both `text` and `curses` interfaces.
Reviewers: #mercurial, durham, ttung
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3723179
Signature: t1:3723179:1471582313:b10d278ca5b1a2aee6b41936f315a960edee92ed
Summary:
The `--print-changes` option will show which commit, a changed lines will be
applied to. Note it is a bit expensive so we only calculate the content when
being asked.
The `--dry-run` option will prevent the final commit operation.
Users can now use `-pn` to preview changes to understand what will be changed.
Test Plan: Run `test-smartfixup.t`
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3719673
Signature: t1:3719673:1471582117:7f3be3c3bf3829148c3d096d2aae6e7382449b98
Summary:
This is the last piece of the initial smartfixup implementation: the command.
A new test was added to test the command.
Test Plan: Run the newly added test
Reviewers: #mercurial, ttung, jbower, durham
Reviewed By: durham
Subscribers: akushner, simonfar, durham, jbower, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3717354
Signature: t1:3717354:1471629588:202e4a5820de472eb131eb968ec73f194d2c077d
Summary:
If `filefixupstate` is to `filecontext`, `fixupstate` is to `context`.
This does the actual committing, creating obsmarkers, moving bookmarks work.
Test Plan: A new test will be included in the next diff
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3716954
Signature: t1:3716954:1471639171:9891a0c64365b0592f5a4d86e3c83d521b4c5bb2
Summary:
The `filefixupstate` object maintains states and contains logic related to
do "smartfixup" to a single file.
Test Plan: Added a new test
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3716761
Signature: t1:3716761:1471919159:033e79e9d12307785863959dd5d82a7c3c647ff3
Summary:
This series is a rewrite of D3264203, using the `linelog` instead of
`histedit`. The new version has the following advantages:
- handle more cases where it could be a merge conflict with a traditional
merge algorithm. the old code tries to "predict" when a merge won't
cause conflicts. but that's just kinda stupid - comparing with the new
code using linelog - it is just impossible to produce merge conflicts.
- do not touch working copy - all intermediate calculations and states are
in memory. say goodbye to the clean working copy requirement of histedit.
- handle line numbers cleanly and confidently - the old code struggles (but
failed) to make line numbers correct after each edits, while it is
actually hard as the "merge" operation could change line numbers in an
unpredictable way. the new code using linelog can just edit chunks from
an old revision, from the latest view without checking out that old
revision first. therefore no need to mess up with line numbers.
This diff adds utility functions and classes used later. It introduces
unused `import`s but they will be used later.
Test Plan: `arc lint`
Reviewers: #mercurial, ttung, durham
Reviewed By: durham
Subscribers: durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3716758
Signature: t1:3716758:1471556512:0fbff8f6fe4bc02d2120c723d2cc28676895c679
Summary:
According to the comments hg-crew, hgext3rd is supposed to be a namespace
package, so that extensions can be found in multiple different hgext3rd
directories.
However, the hgext3rd directory in fb-hgext has an empty __init__.py file,
which turns hgext3rd into a plain package instead of a namespace package,
preventing other hgext3rd directories from being found.
This fixes the __init__.py file to perform proper namespace package
initialization, as is done in the hg-crew/hgext3rd/__init__.py file
Test Plan:
Deployed this file on my server and confirmed that extensions in other hgext3rd
directories in $PYTHONPATH are still found correctly.
Reviewers: rmcelroy, durham, quark
Reviewed By: quark
Subscribers: net-systems-diffs@, yogeshwer, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3746098
Tasks: 12792845
Signature: t1:3746098:1471679643:44a274807d3598a670e1742dee4cc2654f6bad97
Summary:
Limits make no sense anymore because we may be filtering
the results further.
Test Plan: fastlog unit test, run extension against fbsource
Reviewers: quark, durham
Reviewed By: durham
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3743974
Tasks: 12341014
Signature: t1:3743974:1471906692:25f48349bd70781219acdc3cf6b98134035d6236
Summary:
When the restriction of only working on a single directory
was dropped, pattern support was neglected. That has to be done through
a revset, not the looser matches() filter.
Test Plan: P56588753
Reviewers: rmcelroy, quark, stash, durham
Reviewed By: durham
Subscribers: mhammell, meisner, calcsaransh, gqchen, dzhulgakov, kerl, bnitka, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3734232
Tasks: 12341014
Signature: t1:3734232:1471906628:d3995b358d683383fe590fa5848d8450a0ea05dd
Summary: No need for cruft
Test Plan: Load in Atom, no more complaints about unused imports
Reviewers: durham, rmcelroy, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3733509
Tasks: 12341014
Signature: t1:3733509:1471519620:08e896aaff65b545d7d16e5d46ba6a8e2a2bc186
Summary: Document how to enable the extension
Test Plan: Set this in my actual .hgrc and confirm it works.
Reviewers: durham, rmcelroy, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3721128
Signature: t1:3721128:1471342825:e274764e036f1c03b9f8795221af6fe587990340
Summary:
Before this patch, sshaskpass has a hardcoded tmp directory, which, if being
abused, can break sshaskpass from working. This diff fixes the issue by
using tempfile.mkdtemp.
Test Plan:
Run `chg push -r . ssh://root@localhost//tmp/foo -f --allow-ano` and make
sure ssh password prompt works. Also run the sshaskpass test.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3705674
Signature: t1:3705674:1471373405:aec54ac685b060efb616307552cebcccee5cebe8
Summary:
Parallel callout to scmquery through conduit
This implements the special case of log on a single directory, preserving
follow behavior. To do this, we backtrackfrom the current head to find
all draft revisions along the path, then find the common public ancestor of
those. Once we find that, we can begin paging in results from the scmquery
service.
Pretty much a working diff at this point. Limits and boundary conditions
have not been fully tested. Every once in a while I run into a bum query,
which I suspect to be either a bad proxy or a service router failure; still
debugging that. Could also be an issue with conduit. Other than that,
things seem to work.
Test Plan:
Testing log with fastest setting (no revsets), revsets (using -M), and with extension disabled (--sparse):
[zamsden@devbig192.prn1 ~/local/fbcode] time hg log tao --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 -M > a
real 0m1.895s
user 0m0.003s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbcode] time hg log tao --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 > b
real 0m1.308s
user 0m0.005s
sys 0m0.001s
[zamsden@devbig192.prn1 ~/local/fbcode] diff a b
[zamsden@devbig192.prn1 ~/local/fbcode] time hg log tao --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 --sparse > c
real 0m7.320s
user 0m0.004s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbcode] diff a c
Testing --user option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/dragon --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 5 -u dmitri > a
real 0m2.765s
user 0m0.002s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/dragon --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 5 -u dmitri --sparse > b
real 0m23.247s
user 0m0.005s
sys 0m0.001s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing same output enabled / disabled for -X option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -X '**TARGETS' > a
real 0m1.292s
user 0m0.002s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -X '**TARGETS' --sparse > b
real 0m2.697s
user 0m0.002s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing -k option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -k 'e' -X '**TARGETS' -l 10 > a
real 0m1.174s
user 0m0.003s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/lithium/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -k 'e' -X '**TARGETS' -l 10 --sparse > b
real 0m1.259s
user 0m0.004s
sys 0m0.002s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing -I option:
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/scm/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -I '**.py' > a
real 0m1.473s
user 0m0.005s
sys 0m0.003s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/scm/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 20 -I '**.py' --sparse > b
real 0m2.911s
user 0m0.003s
sys 0m0.002s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource]
Testing multiple directory output in all three modes - revset, fast filtered, and forcing original fallback with --sparse
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/hphp/hhvm fbcode/hphp/runtime/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 -M > a
real 0m2.892s
user 0m0.003s
sys 0m0.006s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/hphp/hhvm fbcode/hphp/runtime/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 > b
real 0m2.575s
user 0m0.697s
sys 0m0.077s
[zamsden@devbig192.prn1 ~/local/fbsource] time hg log fbcode/hphp/hhvm fbcode/hphp/runtime/ --config extensions.fbconduit=~/local/fb-hgext/hgext3rd/fbconduit.py --config fbconduit.host=our.zamsden.devbig192.prn1.facebook.com --config extensions.fastlog=~/local/fb-hgext/hgext3rd/fastlog.py --pager=off -l 100 --sparse > c
real 0m7.339s
user 0m0.003s
sys 0m0.004s
[zamsden@devbig192.prn1 ~/local/fbsource] diff a b
[zamsden@devbig192.prn1 ~/local/fbsource] diff a c
[zamsden@devbig192.prn1 ~/local/fbsource]
Reviewers: rmcelroy, #scmquery, #mercurial, ttung, lcharignon, durham, stash
Reviewed By: stash
Subscribers: cdykes, lcharignon, quark, stash, mjpieters, jeroenv
Differential Revision: https://phabricator.intern.facebook.com/D3634075
Tasks: 12341014
Signature: t1:3634075:1471039212:0989839636847a8e5da6a0ef9150035fcf5bb797
Summary:
This diff makes the prompt similar to what systemd does. See the screenshot:
{F62774663}
It solves an issue that with echo disabled, the user won't know whether they
have pressed ENTER or not - the cursor won't move. Now it explicitly prints
"AUTHENTICATION COMPLETE".
Test Plan: As the screenshot, and also run the sshaskpass test.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3705703
Signature: t1:3705703:1471008095:863ff9820b87ea3f4631295b10472802fb5e459f
Summary:
Before this patch, sshaskpass will set SSH_ASKPASS to itself, aka. `__file__`.
This won't work if sshaskpass.py gets installed by setup.py because setup.py
will remove its `+x` bit.
Test Plan:
Run `chg push -r . ssh://root@localhost//tmp/foo -f --allow-ano` and make
sure ssh password prompt works.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3705657
Signature: t1:3705657:1471008122:9cfa3adf078e4bbe8f6b6ba05d1fb6be513d3e71
Summary:
We are seeing perf issues with hidden/obsolete handling.
`hg bookmark` is a frequently used command and by making it use the unfiltered
repo, it could be 200ms-300ms faster.
Test Plan: Added a new test
Reviewers: #mercurial, mitrandir, ikostia, ttung
Reviewed By: mitrandir, ikostia
Subscribers: mitrandir, rmcelroy, akushner, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3692968
Signature: t1:3692968:1470777864:72ad5d0ffb52ecfcaaa607082693b88319d778fd
Summary:
This happens when pressing Ctrl+C during "hg rebase". We should show
"interrupted rebase" instead of "interrupted update".
Test Plan: Added a new test
Reviewers: ttung, #mercurial, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3697984
Signature: t1:3697984:1470863868:acd67eeb5099c73ea7df174b3e1dbcbf9ac54944
Summary:
1) Add sync status
2) Combine sync status and phab status to use one unified conduit call,
i.e. differential.querydiffhashes
Test Plan:
cd hg-crew
make local
cd ../fb-hgext
make local
cd tests
../../hg-crew/tests/run-tests.py test-phabstatus.t
../../hg-crew/tests/run-tests.py test-syncstatus.t
Reviewers: wqfish, lcharignon, #sourcecontrol, wez, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3651915
Tasks: 10100400
Signature: t1:3651915:1470340328:bf003006f6afe9b86a40f204e150e0d12350c21d
Summary:
Fastmanifest debug logs in blackbox.log are less interesting in a rage report,
but they take a lot of lines. This diff uses `grep` to filter them out from rage report.
Test Plan: `hg rage --preview`
Reviewers: #mercurial, ttung
Reviewed By: ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3676751
Signature: t1:3676751:1470421349:3b5e0cb4118473f5550e83bf9c5e7ac27a59bcb0
Summary:
This is mainly to address the same issue as D3609747: prevent issues caused
by running hg as root. The difference is this extension reads owner and uid
dynamically without config when initializing of a localrepo object.
As a side effect it covers more situations like running hg in others' repos, while
being less restrictive for some other commands like `sudo hg version`.
Test Plan: Added a new test
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: ikostia, rmcelroy, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3619997
Tasks: 11723374
Signature: t1:3619997:1470176448:beaf53c09fca498206767641ffa4315a744ee07e
Summary:
We need to get the `.py` file name from `__file__`, which could be `.pyc`
and `.pyo`. Previously only `.pyc` is handled. This diff handles `.pyo`
as well.
Test Plan: Run existing tests
Reviewers: ttung, mjpieters, #mercurial, simonfar
Reviewed By: simonfar
Subscribers: simonfar, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3627929
Signature: t1:3627929:1469625182:1c0f5f720fe7eb4cbe3e6abd8e9407ced617d2a0
Summary:
During chg pull or push over ssh, ssh is started by chgserver which does not
have a controlling tty. Therefore the ssh process won't be able to ask for
passwords interactively.
This is actually a hard issue because an unprivileged process without a ctty
cannot attach to a ctty of another process.
The discussion at upstream tends to make it clear it's part of limitations
of chg. Therefore if we decide to workaround it, it has to live outside core,
thus fb-hgext.
GUI ssh-askpass is actually a good and clean choice. See D3510178 and D3515604.
However, they are for OS X but not Linux.
This diff is a very hacky solution to make ssh-askpass works in terminal.
It starts a "tty server" providing tty I/O fds and set `SSH_ASKPASS` to use a
custom script talking to the "tty server".
Test Plan:
Run the new test. Start a sshd locally and try:
```
$ hg push ssh://root@localhost/tmp
pushing to ssh://root@localhost/tmp
root@localhost's password:
remote: Permission denied (publickey,password).
abort: no suitable response from remote hg!
$ chg push ssh://root@localhost/tmp
pushing to ssh://root@localhost/tmp
==== SSH Authenticating ====
root@localhost's password:
remote: Permission denied (publickey,password).
abort: no suitable response from remote hg!
```
Reviewers: #mercurial, ttung, mpm
Reviewed By: mpm
Subscribers: durham, mpm, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3577509
Tasks: 12029680
Signature: t1:3577509:1469467700:cd93565bd47e535bb4cb41fcdaa39e45dddfae28
Summary:
All of hg journal is now fully upstreamed to mercurial core and remotenames.
Remove the outdated copy here.
Test Plan: --
Reviewers: #mercurial, ttung
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3611123
Tasks: 10804988
Summary:
Since statprof is not an extension, it needs to be treated like a normal python
module.
Test Plan:
```
~/local/fb-hgext> python setup.py build
~/local/fb-hgext> ls build/lib.linux-x86_64-2.6/
cfastmanifest.so hgext3rd/ sqldirstate/
fastmanifest/ phabricator/ statprof.py
```
Reviewers: ttung, #sourcecontrol, quark
Reviewed By: quark
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3607202
Signature: t1:3607202:1469216683:9aa08aee567425c239ddc5d1bb68fd892a8cf6a9
Summary:
Let's use deltas between the subsequent samples instead of sample count
to count the time spent.
Rationale:
When the process is IO blocked the other thread doing the sampling can be waken
up much more often (GIL is not held) causing the profiler to collect much more
samples in that state.
Test Plan:
works in my sandbox
do we have any tests for statprof.py?
Reviewers: durham
Reviewed By: durham
Subscribers: quark, mjpieters, #mercurial
Differential Revision: https://phabricator.intern.facebook.com/D3551431
Signature: t1:3551431:1468543377:f6b86245c957dd59d0334dbb1898f6ad0bb8c617
Summary:
`import hgsubversion` can error out if demandimport is disabled and svn
bindings are not found. In that case, we should be able to continue and
just skip handling svn revisions.
Test Plan: Code review
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3594810
Signature: t1:3594810:1469042572:3f9ab69f5503f6925f455769a78dac42a47087de
Summary:
Be a better citizen under system python path.
Fix all tests issues and change setup.py to use glob pattern to include
all extensions.
Test Plan:
Run tests and `make local`.
Also build and install the package and run `hg sl` in major repos.
Reviewers: #mercurial, ttung, rmcelroy
Reviewed By: rmcelroy
Subscribers: rmcelroy, durham, mjpieters
Differential Revision: https://phabricator.intern.facebook.com/D3534311
Signature: t1:3534311:1468275426:fe122646c8bd6c541e1889e73e9df28f86747ff2