Commit Graph

1710 Commits

Author SHA1 Message Date
Saurabh Singh
285ded5861 gitmeta: refactor and add more test cases to test-git-getmeta.t
Summary:
test-git-getmeta.t has some basic tests to check that the git metadata
syncing  works as expected. I have added some tests for more complicated
scenarios for robust testing. Also, I did some refactoring of the test for
readability.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Differential Revision: https://phab.mercurial-scm.org/D685
2017-09-13 17:17:55 -07:00
Durham Goode
26e92d8ffe tests: update tests for upstream changes
5d45a997d11 in upstream changed rebase to use unfiltered repositories, which
changes the definition of tip in these two tests. Let's update the test output.
2017-09-12 10:10:06 -07:00
Ryan McElroy
ca9289cb2a fbconduit: properly pass through params on local hit
Summary:
Previously, we didn't pass through additional parameters, which resulted in
errors complaining about insufficient arguments.

Test Plan: Added a new test that previously crashed

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D689
2017-09-12 08:04:17 -07:00
Mihails Smolins
bbbb8e96dd cstore: uniondatapackstore support for python stores
Summary:
Now uniondatapackstore can also hold python data stores. PythonDataStore
wrapper simply passes function calls to underlying python objects and marshals
the output.

Test Plan:
* Added test case
* Tested on fbsource with treemanifest.usecunionstore=True

Reviewers: durham, simonfar, ryanmce, #fbhgext

Reviewed By: durham, simonfar, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D631
2017-09-11 09:23:10 -07:00
Saurabh Singh
a55e107c0e copytrace: handle modification of config from disablecopytrace to copytrace
Summary: In mercurial core, the config for disabling copytrace was changed from
disablecopytrace (boolean) to copytrace which can be on or off. As a result of
this change, there were some breaks which need to be modified to work with the
new config. This commit acheives the same.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D662
2017-09-08 18:46:24 -07:00
Saurabh Singh
cd4903b1fb amend: fix test-treemanifest-treeonly.t after amend's redundant commit removal
Summary: cmdutil.amend was changed recently to get rid of the redundant commit
during the amend operation. As a result, we need to update this test as it was
aware of the redundant commit. This commit achieves the same.

Test Plan: Executed the test after the changes.

Reviewers: #fbhgext, durham, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D661

message empty to abort commit. HG: -- HG: user: Saurabh Singh <singhsrb@fb.com>
2017-09-08 11:24:24 -07:00
Saurabh Singh
a6ec1d2188 dirsync: fixing mirroring following removal of redundant commit in amend
Summary: The dirsync extension was relying on the redundant commit in amend to
achieve the mirroring. Now with that commit removed, I decided to wrap the
cmdutil.amend itself so that we can still do the mirroring correctly during the
amend.

I added a new test file test-dirsync-amend.t to test the wrapper over amend.
The test-dirsync.t was an existing test that was broken after the amend
behavior change and has been added again with some changes. It would be best to
review it against its old version.

Test Plan: Ran the test suite.
2017-09-08 10:01:05 -07:00
Saurabh Singh
7daa1a0dda copytrace: fixing amend wrapper following removal of redundant commit in amend
Summary: I just had to ensure that the we were storing the amend information by
checking against the working copy instead of the intermediate commit.

The test-copytrace-amend.t wasn't added in this revision. It is actually an
existing test which was broken after the change in amend behavior. I have added
the test again with minor changes. I think it would be best to diff the test
against its old version for the review.

Test Plan: Ran the test suite.
2017-09-08 10:00:09 -07:00
Saurabh Singh
7f3e8286a8 amend: fixing tests following the removal of redundant commit in amend
Summary:
cmdutil.amend was changed recently to get rid of the redundant commit during
the amend operation. As a result, we need to update the tests which were aware
of the redundant commit. This commit achieves the same.

Note that as a result of the amend behavior change, the dirsync and copytrace
extensions were broken. They will be be fixed in subsequent commits on top of
this commit. For now, the broken tests for these extensions were removed from
the commit. Eventually, I will fold all the fixes together so that revision
history of the tests is not messed up. This is primarily done only to aid the
review.

Test Plan: Ran the test suite after updating the tests.
2017-09-08 09:58:14 -07:00
David Soria Parra
9787efd179 p4fastimport: add --base option to define branchpoint
Summary:
We are adding an option --base to define a starting point for a
new branch. We define --bookmark as the head of the branch (we
might introduce a --dest option in addition). This allows us to create
new branches for release branches and others.

Note that for some reason, `arc unit` is generating different test
results than running the run-test.py manually, causing branch updates in
different situations. Therefore we have to glob a bunch of tests.

Test Plan:
    python ../../hg-crew/tests/run-tests.py test-p4fastimport-* test-check*

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, medson, mjpieters

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

Signature: 5769328:1504763221:78eb81f32ec46fc56619d77537c2b1944e938466
2017-09-07 19:44:16 -07:00
Mihails Smolins
38c4cde5a3 cstore: extend and refactor deltachain class
Summary:
Extended DeltaChain with CDeltaChain and PyDeltaChain which are wrappers around
c and python delta chains respectively. The declaration and implementation
of c and python delta chains as well as DeltaChainLink were put in a different
file.

Test Plan: * Ensure that unit tests pass

Reviewers: ryanmce, durham, simonfar, #fbhgext

Reviewed By: ryanmce, durham, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D630
2017-09-07 08:07:30 -07:00
Durham Goode
0f55351745 tests: update test-infinitepush-pullbackups.t due to upstream
These lines were added in D485 but the diff indicates they weren't sure why
these lines were needed. D608 fixes the upstream bug that caused this, so now
the lines aren't necessary.
2017-09-06 21:57:19 -07:00
Durham Goode
69c8748ee2 test: fix pushvars check code failures 2017-09-06 21:46:16 -07:00
Mihails Smolins
d65b5a13b9 cstore: pythonkeyiterator refactor
Summary:
PythonKeyIterator has been moved to a separate file, because we will need to
include it in several places in future commits.

Test Plan: * Ensure unit tests pass

Reviewers: ryanmce, durham, simonfar, #fbhgext

Reviewed By: ryanmce, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D629
2017-09-05 08:04:55 -07:00
Andres Suarez
6a6c71a9f2 tweakdefaults: support -I and -X in grep
Summary:
Pass-through the common `-I`/`--include` and `-X`/`--exclude` flags to
`scmutil.match`. This gives `hg grep` similar semantics to other commands that
support filtering by pattern.

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

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

Reviewers: #mercurial, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters

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

Signature: 5764306:1504535581:ebc8d9f76bbd243d49b1b3306620b88a4f16e818
2017-09-04 15:45:37 +01:00
Simon Farnsworth
9e23886f80 tests: use python instead of echo -e
Summary:
BSD echo doesn't support -e. The lint rule says to use Python instead,
so follow its advice

Test Plan: Ran tests locally on Mac and Linux.

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D619
2017-09-04 05:26:23 -07:00
Durham Goode
a2cd5ebd96 tests: update test with upstream change 2017-08-31 13:08:41 -07:00
Durham Goode
364ef7af41 tree: don't download flat manifests when cloning in tree only mode
Summary: Prevents downloading any manifest revlogs when the client is in treeonly mode.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D575
2017-08-31 11:14:39 -07:00
Durham Goode
0faa105a6d tree: adds test for pushing a treeonly manifest to a hybrid server
Summary:
This adds a test that pushes a treeonly commit from a treeonly client to a
hybrid server, and verifies the result is written to the server flat and tree
manifests. Also tests that hooks can access the tree data.

This also changes the server to read the treemanifest if a tree was provided in
the bundle. Previously the server would only read trees if the forcereceivetrees
flag was on, which meant we couldn't accept flat and trees at the same time,
which made migrating harder.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D571
2017-08-31 11:14:39 -07:00
Durham Goode
fba182aeee tests: remove orig file from a commit
Summary:
An orig file was getting added to a commit in a test accidentally, which makes
it harder to test the contents of that commit in a future diff. Let's purge that
file before we make the commit. This affects some of the later output because
the hash changes.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D570
2017-08-31 11:14:39 -07:00
Durham Goode
57571a68f0 treemanifest: fix non-tree repos when treemanifest is loaded
Summary:
If the treemanifest is loaded, but not enabled for a repo, it was still
executing tree code for that repo, which would break. This adds checks to
prevent tree code from running in non-tree repositories.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Subscribers: simonfar

Differential Revision: https://phab.mercurial-scm.org/D568
2017-08-31 11:14:39 -07:00
Wez Furlong
9bfe39b9c7 scm-prompt: fixup extraction of the commit when in eden
Summary:
We changed the format a little while back, but neglected to
adjust this script.

Test Plan: run it locally and saw the correct hash.  Revised test case.

Reviewers: simpkins, akushner, mbolin

Reviewed By: mbolin

Subscribers: medson, mjpieters, net-systems-diffs@fb.com, #sourcecontrol

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

Tasks: T21489553

Signature: 5738750:1504122070:43595555652c35e721ff4248a83d615fdc330e6e
2017-08-30 14:25:18 -07:00
Mihails Smolins
4cadb2504b cstore: generic uniondatapackstore
Summary:
Implementation of uniondatapackstore that can hold generic stores.
This diff doesn't support python data stores yet, but provides an abstraction
to the stores that can be used by uniondatapackstore.
DeltaChain and DeltaChainLink wrappers will allow to use C and python chains
and chain links.

Test Plan:
* Ensure that unit tests pass
* Test on fbsource to ensure new code is executed by printfing to stdout
* Ensure the code is built successfully on macOS

Reviewers: durham, ryanmce, simonfar, #fbhgext

Reviewed By: durham, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D560
2017-08-30 11:37:25 -07:00
Durham Goode
e187dcbbd6 treemanifest: add test for hg bundle support
A simple test for hg bundle/unbundle
2017-08-29 13:02:22 -07:00
Durham Goode
1ad5d48f77 treemanifest: add test for peer-to-peer push/pull 2017-08-29 13:02:22 -07:00
Durham Goode
bb3289435b treemanifest: add test for histedit in treeonly mode
Test covering a simple histedit in treeonly mode.
2017-08-29 13:02:22 -07:00
Durham Goode
c16a1ef8df treemanifest: fix rebasing in treeonly mode
Adds a test for rebasing in tree only mode and fixes a bug in readdelta where it
was returning the parent's file nodes instead of the current file nodes. The
test covers this case.
2017-08-29 13:02:22 -07:00
Durham Goode
be98ac261a treemanifest: support pull in a treeonly repository
In order to support pulling from the main server, we need to:

- ignore the flat manifest part of the changegroup
- change our treeonlymanifestlog to do store.get() instead of
  store.getmissing(), since only get() fetches from the remote server.
2017-08-29 13:02:22 -07:00
Durham Goode
75e615d919 tests: add a test for client side treeonly support 2017-08-29 13:02:22 -07:00
Dylan Richardson
5b84495e9e copytrace: use full version of copytrace for draft branch rebases
Summary: on merge during rebase, check to see if source and destination are both draft commits. If so, use full copytrace to support more functionality.

Test Plan:
In tests/test-copytrace.t, added two tests:
- Change a file name and move containing directory in one branch. Modify contents of original file name in other branch. Rebase modded file into new file name in new directory.
- Move directory in one merge parent. Add new file to original directory in other merge parent. File moved to new directory on rebase.

Reviewers: stash, #fbhgext

Reviewed By: stash, #fbhgext

Subscribers: pulkit, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D481
2017-08-29 08:57:54 -07:00
Adam Simpkins
ecb0fd2dd7 clib: update C/C++ copyright statements to pass lint checks
Summary:
Update the copyright headers in most of the C/C++ code consistently use the
GPLv2 copyright message.  This allows these files to pass Facebook's internal
C/C++ linters.

Some of the files in fbcode/scm/hgext/cstore/ appear to have actually been
copied from the hg-crew repository, and were not originally authored by
Facebook.  I have not modified the copyright statements in these files:

- cstore/bitmanipulation.h
- cstore/compat.h
- cstore/mpatch.h
- cstore/mpatch.c

I also have not modified any of the cfastmanifest code.

This corresponds to Facebook diff D5588677.

Test Plan:
Confirmed that Facebook's C++ linters no longer complain about the copyright
messages.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D507
2017-08-25 16:46:07 -07:00
Adam Simpkins
702f276ede ctreemanifest: move ManifestPtr to its own header file
Summary:
Define the ManifestPtr class in its own header file, to eliminate some of the
nasty circular dependencies between manifest.h, manifest_entry.h, and
manifest_fetcher.h

This makes the include process for these files much simpler, and prevents
manifest.h and manifest_entry.h from both trying to include each other at
different locations in their files.

This corresponds to Facebook diff D5588672.

Test Plan: Confirmed "make local" succeeds and the unit tests pass.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D506
2017-08-25 16:46:07 -07:00
Mihails Smolins
de2fbf4ada remotefilelog: keepset tuple bug fix
Summary:
Keepset computation algorithm added tuples to the keepset that are the results
of diffs between two manifests. Now it has been fixed and only new node from
the tuple is added to the keepset.

Test Plan:
* Run hg gc on www, fbsource
* Ensure the unit tests pass

Reviewers: simonfar, durham, #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D519
2017-08-25 10:06:43 -07:00
Durham Goode
8c688d88da tests: actually fix flakey test
Which packs get cleaned up is non-deterministic in some cases, so grepping for
the 'x' in this test did not catch when a non-x pack was left behind, which
caused flakey output. Let's instead check that 3 packs were left behind and one
of them was from the small generation.
2017-08-25 09:23:34 -07:00
Mark Thomas
6455de7566 tweakdefaults: make pull --rebase ffwd if nothing to rebase
Summary:
Pull --rebase when you have local draft commits moves your commits,
your working copy, and your active bookmark to the new branch head
(or whatever destination you specify with -d).  If you don't have
any local draft commits, it doesn't do any of that.

This change makes it so that it does everything except moving the
commits.

Test Plan: Added new unit tests.  Re-ran existing ones.

Reviewers: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D518
2017-08-25 09:01:41 -07:00
Durham Goode
e5dd4fdd58 tests: fix flakey repack test
If a bunch of packs are the same size, the ones repack chooses to pack is
non-deterministic. This was causing flakiness in the test as different packs
were being left behind. Let's remove that dependency.
2017-08-24 16:31:05 -07:00
Michael Bolin
9578f20605 spelling: change commited -> committed
Summary:
We have an internal linter that keeps yelling at me about this spelling error.

I created this by running:

```
hg grep -l 'commited' | xargs sed -i -e 's#Changes commited as#Changes committed as#g'
```

Test Plan: CI

Reviewers: durham, quark

Reviewed By: quark

Subscribers: medson, mjpieters, stash, jeroenv

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

Signature: t1:5699238:1503596778:de5e4f26daeaf3649c6c09ded6bd2b459b0e5f97
2017-08-24 14:13:58 -07:00
Felix Merk
48ec146530 undo: better error messaging and hiding hg serve commands
In interactive mode, disables out of bounds <-,-> notifying the user with text
and a '\a' sound.  Friendlier ui messages for when the user selects the current
state with the arrow keys or when trying to undo to a state before we recorded
anything.  Hg serve commands generally aren't user executed and simply should be
skipped across when undoing (like unfinished states).  The user can always use
--absolute to see them in preview and to undo to them.

Differential Revision: https://phab.mercurial-scm.org/D502
2017-08-24 12:29:40 -07:00
Durham Goode
7d2bdf6f8e repack: fix incremental repack for large quantities of packs
Summary:
Previously incremental repack would only take the top 3 packs in a generation of
packs. For instance, if there were 100 packs between 1KB and 1MB, it would only
repack the first 3, instead of repacking a whole bunch because it's cheap. This
patch fixes it to grab as many packs in a generation as it can fit under the
limit (default of 100MB of pack data).

This will fix an issue where we're seeing users with 100's of tiny pack files
that aren't getting repacked fast enough.

Test Plan: Added a test

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D500
2017-08-24 09:31:10 -07:00
Mark Thomas
986a478c59 tweakdefaults: make histedit update dates of commits it edits
Summary:
tweakdefaults already overrides amend, rebase and graft to update the commit date
to the current time when it creates new commits.

This extends this to also give the same behavior to histedit.

Test Plan: New unit test added.

Reviewers: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D490
2017-08-24 07:45:02 -07:00
Durham Goode
3f740e778f undo: fix test broken by previous commit 2017-08-23 23:59:34 -07:00
Jun Wu
05c526a68e infinitepush: update test to reflect upstream change
It seems `debugcheckbackup` could get a new kind of error with the latest
upstream code:

  Traceback (most recent call last):
    File "hg/mercurial/scmutil.py", line 150, in callcatch
      return func()
    File "hg/mercurial/dispatch.py", line 292, in _runcatchfunc
      return _dispatch(req)
    File "hg/mercurial/dispatch.py", line 896, in _dispatch
      cmdpats, cmdoptions)
    File "hg/mercurial/dispatch.py", line 658, in runcommand
      ret = _runcommand(ui, options, cmd, d)
    File "hg/mercurial/dispatch.py", line 904, in _runcommand
      return cmdfunc()
    File "hg/mercurial/dispatch.py", line 893, in <lambda>
      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
    File "hg/mercurial/util.py", line 1118, in check
      return func(*args, **kwargs)
    File "hg/mercurial/extensions.py", line 322, in closure
      return func(*(args + a), **kw)
    File "hg/mercurial/util.py", line 1118, in check
      return func(*args, **kwargs)
    File "hg/hgext/mq.py", line 3542, in mqcommand
      return orig(ui, repo, *args, **kwargs)
    File "hg/mercurial/util.py", line 1118, in check
      return func(*args, **kwargs)
    File "fb-hgext/infinitepush/backupcommands.py", line 272, in checkbackup
      if not _dobackupcheck(bkpstate, ui, repo, dest, **opts):
    File "fb-hgext/infinitepush/backupcommands.py", line 469, in _dobackupcheck
      for r in lookupresults:
    File "hg/mercurial/wireproto.py", line 137, in results
      next(batchable)
    File "hg/mercurial/wireproto.py", line 238, in lookup
      self._abort(error.RepoError(data))
    File "hg/mercurial/sshpeer.py", line 235, in _abort
      raise exception
  RepoError: 0e1a088ff2825213eaa838a82a842bc186f10dd5
  abort: 0e1a088ff2825213eaa838a82a842bc186f10dd5!

The error message only contains a commit hash, which is not friendly to be
printed out. Therefore make sure we have control about the error message and
update the test accordingly.

Differential Revision: https://phab.mercurial-scm.org/D485
2017-08-22 21:58:37 -07:00
Pulkit Goyal
9c86deebae pushvars: cleanup the extension to just set the server config option
The --pushvars option to push is moved to core with an extra config named
push.pushvars.server which defualts to False. This config controls whether the
server to unbundle the variables send by pushvars.

To make sure nothing breaks for those with pushvars extension enabled,
this should be added to the configuration file:

[push]
pushvars.server = True

Differential Revision: https://phab.mercurial-scm.org/D365
2017-08-23 09:28:07 +05:30
Pulkit Goyal
c288e6c436 bundle2hooks: remove the extension from hgext3rd as it is moved to core
The ability to add hookargs to a bundleoperation object has been added to the
core from this extension.

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

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

This patch also removes the test of the extension.

Differential Revision: https://phab.mercurial-scm.org/D363
2017-08-23 09:28:07 +05:30
Adam Simpkins
5977867b68 sha1: provide wrapper functions around the SHA-1 implementation
Summary:
Add a clib/sha1.h file with SHA-1 utility functions that hide the details of
the underlying SHA-1 implementation being used.  This will make it easier in
the future if we want to use the faster SHA-1 implementation from OpenSSL if it
is available, but fall back to the sha1collisiondetection library if it is not
available.

Test Plan: Confirmed the code builds and passes unit tests.

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D282
2017-08-22 19:09:07 -07:00
Adam Simpkins
d5440b15c4 sha1: move the sha1collisiondetection code to third-party
Summary:
Move the third-party sha1collisiondetection code from clib/sha1 to
third-party/sha1dc.  This helps isolate third-party code from our own
internally developed code.

This also updates the code to use the same include paths and library names as
used by the sha1collisiondetection's upstream Makefile, which would be needed
to link against a version of sha1collisiondetection installed locally.

Test Plan:
Confirmed "make local" succeeds.

All of the tests pass, except for test-check-commit-hg, which complains about
the fact that some of this third-party code contains multiple empty lines in a
row.  It doesn't seem straightforward to update test-check-commit to ignore
this third-party code, but these test failures shouldn't affect any future
commits.

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D281
2017-08-22 19:09:07 -07:00
Sonia Kim
7ef1e18d89 lfs: include filename in object lookup fail message
Summary: Object lookup fails in blobstore provided vague error message when a specific file was not present. Updating error message to reference the filename associated with the blob not found.

Test Plan:
In facebook-hg-rpms/fb-hgext/tests directory:  rt test-lfs-test-server.t
Shows no error and validates that correct error message is displayed

Reviewers: quark, rainee, davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: T18972111

Signature: t1:5617283:1503070630:56fdcab5295ce7d050a24f1a989806066ef7054f
2017-08-22 10:54:41 -07:00
Felix Merk
9df57fe0d2 undo: preview change - just show delta
Change preview to just show the delta and connected commits.  This means we need
to calculate oldworkingcopyparent and bookmarks diffs.  This output will be
cleaner especially for people with a lot of commits in their repo.

Differential Revision: https://phab.mercurial-scm.org/D467
2017-08-22 10:18:03 -07:00
Stanislau Hlebik
d90c0a301d infinitepush: always require a pattern for --list-remote
Summary:
--list-remote can return too many nodes if used without a pattern.
Let's require a pattern.

Test Plan: Run unittests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D221
2017-08-22 01:24:23 -07:00
Jun Wu
805ddc8422 codemod: be compatible with upstream change
D319 renamed `peer.pipe[ioe]` to `peer._pipe[ioe]`.
D320 removed `peer.batch`.
D331 renamed `subprocess` to `_subprocess`.
D336 renamed `_capabilities` to `capabilities`.

Let's be compatible with those changes.

Differential Revision: https://phab.mercurial-scm.org/D425
2017-08-21 15:10:41 -07:00
Felix Merk
e45f912211 undo: preview shows command and time output
Makes hg undo -i and hg undo -p output show an "undo to time, before command"
message and adds directions (left, right, return, q).  Also adds pager check as
pager break interactiveui.

Testing: run hg undo -p and hg undo -i and see output

Differential Revision: https://phab.mercurial-scm.org/D448
2017-08-21 11:25:36 -07:00
Felix Merk
721459469f undo: draft obsolete handling
Obsoleted commits may be visible.  To make sure that they are un-obsoleted after
undo when appropriate, we add "draft() & obsolete()" recording.  The most common
case where this matters is undoing a mid stack amend.

Differential Revision: https://phab.mercurial-scm.org/D438
2017-08-18 11:40:18 -07:00
Felix Merk
2d555e35dd undo: informative output
Instead of the _showstats output from hg.py, we now output the args and time of
the mercurial command we are undoing.

Differential Revision: https://phab.mercurial-scm.org/D412
2017-08-18 11:37:45 -07:00
Felix Merk
aa2547d949 undo: unfinished command handling
hg rebase, histedit, unshelve and other commands may stop in an unfinished state
because of merge conflicts or other reasons.  The user then has the ability to
continue or abort.  Undoing in this case is slightly tricky as for example
aborting a rebase will perform real strips and so undo will fail with an error.
This change still records these states, but flags them as unfinished and skips
over them when undoing and redoing.  Hg undo --absolute does not ignore these
states in the really unlikely situation you want to go to one of them.

Differential Revision: https://phab.mercurial-scm.org/D410
2017-08-18 11:37:45 -07:00
Ryan McElroy
efdd3372ea dirsync: update tests for upstream behavior change
Summary:
Since f33f2b5b487453a0387c80a2d736ec450696cefe, a failed `hg commit -A` will no
longer update the dirstate.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D433
2017-08-18 03:11:29 -07:00
Mateusz Kwapich
432714c0bf perftweaks: don't crash if the rebase dest is None
Summary: This happens in case of "pull --rebase" if the source is ancestor of destination

Test Plan: see the new test, it's making hg crash without this change

Reviewers: #fbhgext, ryanmce, simonfar

Reviewed By: #fbhgext, ryanmce, simonfar

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D436
2017-08-17 12:15:02 -07:00
Jun Wu
6e9f7aeb68 absorb: preserve phase
When rewriting changesets, preserve their phases.

Fixes https://bitbucket.org/facebook/hg-experimental/issues/10/hg-absorb-doesnt-preserve-commits-phase

Differential Revision: https://phab.mercurial-scm.org/D418
2017-08-16 13:40:00 -07:00
Mihails Smolins
a2bdf68679 remotefilelog: limit number of changesets to be prefetched
Summary:
Added config option 'prefetchdays' which indicates that commits older than
'prefetchdays' days should not be prefetched. This option is necessary to avoid
prefetch of huge amount of data. The default value is set to 14 days.

Test Plan: Ensure that unit tests pass

Reviewers: ryanmce, simonfar, durham, #fbhgext, simpkins

Reviewed By: #fbhgext, simpkins

Subscribers: simpkins

Differential Revision: https://phab.mercurial-scm.org/D420
2017-08-16 13:21:31 -07:00
Mihails Smolins
a46c678ab9 remotefilelog: flaky bgprefetch test fix
Summary:
The test fails due to a race condition. Now the failing part of the test
output is optional.

Test Plan: Ensure that unit tests do not fail

Reviewers: ryanmce, simonfar, #fbhgext

Reviewed By: ryanmce, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D417
2017-08-16 09:16:07 -07:00
Ryan McElroy
73ea227f7d treemanifest: make tests more lenient and fail more descriptively
Summary:
The test-treemanifest-pushrebase test was failing in our continuous integration
environment with a perplexing error:

```
$ pushclients
+ abort: exporting bookmark master failed!
```

(plus some additional failures later)

I thought this should not be possible because of the redirect, but it turns out
that the order of the redirects matters:

`>/dev/null 2>&1` redirects both stderr and stdout to `/dev/null`, but
`2>&1 >/dev/null` redirects stdout to /dev/null and stderr to stdout

(TIL)

However, this was the only clue to the issue that was going on, and so it's
better to actually keep the error around, if one occurs, so I removed the 2>&1
redirect altogether.

Furthermore, the test was failing with various clients failing to push.
To increase the chance of this succeeding, I'm bumping the sleep time. Ideally,
we should wait for the server to be "ready", but I'm not certain what that means
or how to test and would like to discuss to figure it out. This hopefully will
unblock the continuous integration for now.

Test Plan: Test still passes locally; wait to see if it passes in automation.

Reviewers: #fbhgext, mitrandir

Reviewed By: #fbhgext, mitrandir

Differential Revision: https://phab.mercurial-scm.org/D415
2017-08-16 16:12:04 +01:00
Jun Wu
50e07b913e test: do not ignore test-check sanity check
Previously, if the system hg does not work, `helper-testrepo.sh` will skip
the test (usually `test-check-*.t`). This patch makes it stricter so a
non-functional system hg will be an error so it's less likely to be ignored.

Differential Revision: https://phab.mercurial-scm.org/D387
2017-08-15 16:56:54 -07:00
Felix Merk
00870d6060 undo: don't break when undo isn't first argument
Undo commands where undo wasn't first, for example `hg --pager=off undo` break
multiple things, including hg redo.  This change fixes this.

Differential Revision: https://phab.mercurial-scm.org/D396
2017-08-15 16:56:25 -07:00
Felix Merk
8a98220afc undo: invalidate false cache
Mercurial sometimes leaves bad caches.  Easiest example is when updating to a
hidden commit, where hg undo will fail, but can be reproduced with many commands
(such as fold which is used for testing here).

Test Plan:
unit tests

Differential Revision: https://phab.mercurial-scm.org/D395
2017-08-15 16:56:25 -07:00
Simon Farnsworth
0d8b65f603 tweakdefaults: do not change the date when using amend --to
Summary:
amend --to is a thin wrapper around histedit, and fails if you ask it
to update the date. tweakdefaults can be configured to ask amend to change the
date. When this is the case, don't change the date when using --to, so that it
can work.

Test Plan:
Test case added here fails before the change complaining about other
flags with --to, and fails in the histedit afterwards (I'm not clear on why - I
suspect phases are significant here).

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D349
2017-08-15 07:21:37 -07:00
Mihails Smolins
7cd5d8e5d5 remotefilelog: fix flaky bgprefetch test
Summary: The test failed due to a race condition. Now the failing part of the test output is optional.

Test Plan: Ensure that unit tests do not fail

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D407
2017-08-15 03:53:34 -07:00
Felix Merk
db3ca9f593 undo: improved --branch handling
Adds --branch handling to the no argument redo.  Also adds better branch testing
and takes a more sensible approach to an undo after an undo --branch.

Redo now restores undoredo.i's --branch field.  Undo after a undo --branch is
now an absolute undo.  See test cases.

Test Plan:
unit

Differential Revision: https://phab.mercurial-scm.org/D324
2017-08-11 18:05:03 -07:00
Felix Merk
5cd0a8ae43 undo: better docs
Strips docs of unnescerary info and sticks complex things behind --verbose flag.
In most cases hg undo and redo or hg undo --preview should be enough for the
user.  Also changes --index to --step, which seems clearer.

Differential Revision: https://phab.mercurial-scm.org/D287
2017-08-11 18:05:03 -07:00
Felix Merk
1041cbca21 undo: no argument redo
Changes redo to straight up undo the previous undo.  This is a bit trickier than
it may seem.  The previous redo capabilities are still covered in hg undo as
--index accepts negative numbers allowing you to step both forward and
backwards one step at a time.  The new redo reads the linear undo log to find
out where to undo to while updating the undo/redo index allowing you to continue
from where you left off.

Differential Revision: https://phab.mercurial-scm.org/D286
2017-08-11 18:05:03 -07:00
Felix Merk
223355effd undo: add --index and redo support to preview
Adds --index handling for --preview.  With the added handling, preview also
works for redo.  In order to bypass template logic, we simply change the
"undoredo.i" file and reset it afterwards.

Differential Revision: https://phab.mercurial-scm.org/D207
2017-08-11 18:05:03 -07:00
Felix Merk
070ee13318 undo: basic --preview
Allows for hg undo --preview to see smartlog like preview of what undo will do.
This will be neccesery before a general roll-out so users can see what undo will
do.  This first iteration only shows what "hg undo" will do, not redo and not
--index.

Differential Revision: https://phab.mercurial-scm.org/D206
2017-08-11 18:05:03 -07:00
Zhihui Huang
587971de01 p4fastimporter: handle blob commits
Summary: Since a blob commit does not associate with a p4 changelist, while a regular commit mirrored a p4 change has a p4 changelist number, p4fastimporter needs to know how to handle a blob commit. The solution here is to get p4basecl number (which tells it which changelist number it's based on when creating this blob commit) from the blob commit node, and import from there.

Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/test
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-blobcommit.t
$ python ../../hg-crew/tests/run-tests.py test-p4*

All tests should pass

Reviewers: #idi, davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: 20141624

Signature: t1:5544046:1502405269:9f449550d60b9d29d8be464ab1cc98500bc60cad
2017-08-10 17:54:18 -07:00
Zhihui Huang
bf31927f4c p4fastimporter: blob commits - support lfs
Differential Revision: https://phabricator.intern.facebook.com/D5560829
2017-08-10 17:54:18 -07:00
Zhihui Huang
06ebaed0bb p4fastimporter: blob commits - support bookmark
Differential Revision: https://phabricator.intern.facebook.com/D5550722
2017-08-10 17:54:18 -07:00
Zhihui Huang
49930828ea p4fastimporter: blob commits
Differential Revision: https://phabricator.intern.facebook.com/D5542123
2017-08-10 17:54:18 -07:00
David Soria Parra
dde1b0d2d2 p4fastimport: decode special perforce characters in filenames
Summary:
Perforce encodes certain characters in filenames (see
https://www.perforce.com/perforce/doc.current/manuals/cmdref/filespecs.html)
We must decode this before we add it to Mercurial.

Test Plan:
  python ../../hg-crew/test/run-tests.py test-check* test-p4fastimport*

Reviewers: #idi, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, steaphan, medson, mjpieters

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

Tasks: 20133877

Signature: t1:5570533:1502010300:0ef3ce0c228c61e23396b5a8ac887ac8c65812ff
2017-08-10 15:49:15 -07:00
Mihails Smolins
4bbe319f4c remotefilelog: add repack to hg gc
Summary: Now on hg gc incremental repack is run if configured

Test Plan: Added a test case

Reviewers: simonfar, durham

Reviewed By: durham

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 19727557

Signature: t1:5583902:1502221690:dce09112207e9e4595458d61a7b73f1210d3b012
2017-08-09 11:04:46 -07:00
Mihails Smolins
9922a9fdde remotefilelog: date command on mac bug fix
Summary: Linux command for the date 100 seconds from now didn't work on mac.

Test Plan: Tested that new expression works on both mac and linux

Reviewers: rmcelroy

Reviewed By: rmcelroy

Subscribers: medson, mjpieters, #mercurial

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

Signature: t1:5592832:1502295105:eb281ee3948f29fcadbe4389d90be434751d37bf
2017-08-09 09:13:31 -07:00
Jun Wu
2e023a378c test-pushrebase: do not match detailed output of "running ..."
The debug output of "running ..." has been changed. Update our test
accordingly.
2017-08-08 15:12:11 -07:00
Mihails Smolins
227be4a118 remotefilelog: fixed failing test
Summary: After fixing prefetch after prefetch and repack bug, test output changed.

Test Plan: Not required

Reviewers: simonfar, durham, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, medson, mjpieters, #mercurial

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

Signature: t1:5583622:1502215262:22b51ea4da10de3996460161f910a4fec65afd9b
2017-08-08 11:04:48 -07:00
Mihails Smolins
2f4474e9ab remotefilelog: update hg gc keepset
Summary:
Now hg gc keepset includes pullprefetch and bgprefetchrevs revsets to avoid
garbage collection of prefetched in background data.

Test Plan: Added test case, also tested in *-gcrepack.t

Reviewers: durham, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 19727557

Signature: t1:5583184:1502208410:c247d802cf27c0143b6d7e2d95029bad5f344499
2017-08-08 09:11:39 -07:00
Durham Goode
cedafbb53b fastmanifest: migrate to use new manifestlog.datastore
Summary:
The tree datastores have moved from the svfs to the manifestlog. Let's update
fastmanifest to use them from there.

Test Plan: Ran the tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D235
2017-08-07 19:27:18 -07:00
Jun Wu
ba4766820a configwarn: new extension to warn about unsupported configs
We have seen issues caused by user config file (`~/.hgrc`) having
unsupported extensions enabled. This new extension would allow us to warn
users about those problematic configs.

Differential Revision: https://phab.mercurial-scm.org/D154
2017-08-07 13:16:09 -07:00
Mihails Smolins
760abb3739 remotefilelog: fixed repeated prefetch after prefetch and repack bug
Summary:
The bug was the following:
If you run hg prefetch, then hg repack, then hg prefetch, the second prefetch
downloads the same things as the first prefetch, even though the items are
already in the pack file.
That happened because Mercurial only checked if loose files exist before
prefetching(it didnt consider pack files). Now it also checks pack files.

Test Plan: Added test case, tested manually on www

Reviewers: simonfar, durham

Reviewed By: durham

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 20797710

Signature: t1:5574070:1502124107:34cfabcfdcb81da79aff565641c9002bfe548def
2017-08-07 12:33:30 -07:00
Mihails Smolins
bbd44be472 remotefilelog: garbage collection on repack
Summary:
Implemented initial version of a garbage collector for repack. Garbage
collection is only performed if gcrepack flag is set in config. Currently
data that is old and not in keepset is garabage collected. The age of data at
which point it will be garbage collected can be specified in config as well.

Test Plan: Added a test case

Reviewers: durham

Reviewed By: durham

Subscribers: rmcelroy, medson, mjpieters, #mercurial

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

Tasks: 19727521

Signature: t1:5548194:1501882489:cc775ec95aa6fafc462a46f99d790f231139ce27
2017-08-07 11:30:53 -07:00
Zhihui Huang
84229312d5 p4fastimport: handle race condition with config users and time delta
Summary: This is a followup diff of this diff: [[ https://phabricator.intern.facebook.com/D5509536 | D5509536 ]]. It makes the ignored user and the constraint on time difference between a user commit and a p4fastimporter import configurable.

Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/tests/
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-gitfusion-race-condition.t
$ python ../../hg-crew/tests/run-tests.py test-p4*

All tests should pass

Reviewers: #idi, davidsp

Reviewed By: davidsp

Subscribers: wlis, medson, mjpieters

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

Tasks: 20141882

Signature: t1:5531404:1501866435:25686443d99a2b96f8e8a7fa9e3f660ba8c8393e
2017-08-04 10:58:07 -07:00
Kostia Balytskyi
099d4692bb sparse: use correct cwd-prepending with patterns
Summary:
Change fb-hgext's sparse to treat patterns correctly (this was brought to
my attention by @martinvonz on the mailing list).

This patch makes sure that:

```
  reporoot/subdir$ hg --include **/file
```

results in `subdir/**/file` being included rather than `subdir/`.

Test Plan: rt

Reviewers: mjpieters, durham, #fbhgext

Subscribers: martinvonz

Differential Revision: https://phab.mercurial-scm.org/D225
2017-08-04 06:16:45 -07:00
Kostia Balytskyi
c979f86f0a lint: fix undo-related warnings
Summary: Before this `test-check-code-hg.t` failed on `undo`-related things.

Test Plan: - rt

Reviewers: felixmerk, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D226
2017-08-04 06:08:23 -07:00
Felix Merk
2e993a8456 undo: localbrach fancy indexes
Adds smart indexing to localbranch undoes. This eliminates the mental burden of
the user of keeping track in what order and when changes where made.  Drawback
is that it raises the computational complexity from the number of draft
commits to draft commits times how many repo states you are undoing.  Common use
case should be to undo a small number of changes, so this is acceptable.

hg undo -b changectx finds the closest pertinent change and undoes that.  -b
with -n is not supported.  The reason it is not supported is that local branch
level undoes are delta specific and not state specific, which in essence means
that running hg undo -b # twice is not guaranteed to give you the same resault
as running hg undo -b # -n 2.  We could run -b multiple times for a -n, but the
cost of a -b increases with a larger -n (which isn't the case for a standard
undo), and abort handling would be more complicated (I'm not sure how well we
can roll back a tree of obs markers?).  In essence -n with -b is not that
usefull a feature (bc perf limits) and would potentially require a decently large
amount of time to implement correctly.

Also adds redo -b since this command now makes a lot more sense when we use the
smarter indexing.  Adds logic to seperate undoes and redoes in different
branches.  You can perform relative undoes and redoes within the latest scope,
while undoes and redoes within a new scope will start at the present (absolute)
state.

Differential Revision: https://phab.mercurial-scm.org/D186
2017-08-03 15:17:21 -07:00
Felix Merk
c280eb12b5 undo: basic single repo undo
Add the ability to undo changes within one 'localbranch'.  In the future, this
will probably become default behavior.  Undo -b changecontext will undo changes
belonging to the local branch identified by the changecontext (see revset
localbranch).  Based on obs markers we can identify connected commits that we
in turn reveal or hide outside of this localbranch.  This undo allows users to
work on multiple branches independantly.

Currently, indexing for undoes is still on the repo level.  This isn't good
from a ux experience.  Next up would be localbranch level indexing logic and
redo logic.

Differential Revision: https://phab.mercurial-scm.org/D160
2017-08-03 15:17:21 -07:00
Felix Merk
a10bb81e36 undo: localbranch revset
Adds localbranch revset to be used for localbranch undos.  A localbranch is a
set of draft commits that are connected via draft commits.  Any draft commit
within a branch, or a public commit at the base of the branch, can be passed as
an argument to localbranch().  This will be necessary for selecting the scope
for a localbranch undo.  Also fixes oldraft() output when used with other
revsets.  Previously olddraft() would ignore operators such as and because of a
missing the necessary handling.

Differential Revision: https://phab.mercurial-scm.org/D159
2017-08-03 15:17:21 -07:00
Mateusz Kwapich
e570184225 crdump: fix tests on OSX
Summary: We need a check-code for that.

Test Plan: tested on my laptop

Reviewers: #fbhgext, ryanmce, ikostia

Reviewed By: #fbhgext, ryanmce, ikostia

Subscribers: ikostia

Differential Revision: https://phab.mercurial-scm.org/D222
2017-08-03 08:50:12 -07:00
Mateusz Kwapich
86cc4e67ff crdump: introduce extension to dump data for code review tools
Summary:
We've spent a lot of time hacking around the outputs of hg in jf (a new
tool we use at FB to interact with our code-review system). We've figured out that it
could be all avoided and made cleaner with simple hg extension that dumps all
the data we need in a format that we can easily consume.

Test Plan: see attached test

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D205
2017-08-03 04:50:46 -07:00
Jun Wu
054d4b010d Backed out changeset 95334859434c
It's breaking Linux tests. I spent some time reading the shell script but
cannot figure out what's wrong quickly, so backing it out to unblock
contbuild now.
2017-08-02 11:44:18 -07:00
Jun Wu
6a528bce1e test-infinitepush-backup: do not test ls output 2017-08-02 11:29:03 -07:00
Luke Petre
cc24d00df6 infinitepush: display backup state in scm-prompt
Summary: - update the scm-prompt.sh script to display when there have been local changes that haven't backed up in four hours

Test Plan: arc unit tests/test-scm-prompt-hg.t

Reviewers: rmcelroy, stash

Reviewed By: rmcelroy

Subscribers: medson, mjpieters

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

Tasks: 18349390

Signature: t1:5498437:1501083894:8a8872df2c6492006c8a76c365d53a3b9a41933a
2017-08-02 16:42:08 +01:00
Luke Petre
0b56f3786a infinitepush: write infinitepush backup status
Summary:
  - change the infinitepush extension to record additional state when the a backup occurs.
  - useful for other tools (scm-prompt, nuclide) to indicate when a backup hasn't occurred recently

Test Plan:
  - cd facebook-hg-rpms/
  - source hg-dev
  - cd fb-hgext
  - arc unit

Reviewers: rmcelroy, stash

Reviewed By: stash

Subscribers: rmcelroy, medson, mjpieters

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

Tasks: 18349390

Signature: t1:5321221:1501271966:6698785e0714e3ecf7e1e2684d1e62e52ac0f1a0
2017-08-02 16:42:08 +01:00
Luke Petre
b4d16230a3 infinitepush: relax hostname regex in tests
Summary: My hostname contains an underscore and that causes these tests to fail.

Test Plan: arc unit tests/test-infinitepush-logging.t

Reviewers: stash

Reviewed By: stash

Subscribers: medson, mjpieters

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

Signature: t1:5498213:1501229709:6cd63cd0e7e644388d21f516893dcd8fb48e75de
2017-08-02 16:42:08 +01:00
Jeroen Vaelen
f0ed4c94e4 tweakdefaults: add ellipsis to trimmed showupdated commit messages
Summary:
Keep `showupdated` commit messages limited to a 50 character width,
with a "..." ellipsis to signify that the message was trimmed.

Test Plan: Added a test.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Differential Revision: https://phab.mercurial-scm.org/D217
2017-08-02 07:56:58 -07:00
David Soria Parra
7361dd4561 p4fastimport: fix symlink handling
Summary:
Symlinks must not have newlines at their end. However reading the
content from Perforce, it might contain a newline, so we now strip it.

Test Plan:
  python ../../hg-crew/tests/run-tests.py --keep-tmpdir test-p4fastimport-import-modes.t

Reviewers: #idi, #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, medson, mjpieters

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

Signature: t1:5535514:1501601075:20ce811a92d1d5b5a973e05db1d2110599c5ef52
2017-08-02 00:00:47 -07:00
David Soria Parra
66dc73070e p4fastimport: make tests not depending on environment
Summary:
The debug output of p4fastimport depends on the users environment (e.g. cvs
tools installed or not). Glob the corresponding output

Test Plan:
Tests didn't run before on my machine,
now they run

Reviewers: #mercurial, rmcelroy

Reviewed By: rmcelroy

Subscribers: rmcelroy, medson, mjpieters

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

Signature: t1:5535504:1501613540:f6f42e97eb0e7515146eea888bfd758759d69f71
2017-08-02 00:00:47 -07:00
Mark Thomas
3bc43d7087 age: add age revsetpredicate extension
Summary:
Adds a new revsetpredicate: `age()`, which matches changesets that are
older or younger than a certain age.

Test Plan: Add new unit test for the predicate.

Reviewers: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D196
2017-08-01 03:12:04 -07:00
Mark Thomas
c8581c4465 infinitepush: add summary of not-backed-up files to smartlog
Summary:
Allow summarisation of commits that have not been backed up
by infinitepush.

1. Add a template keyword (backupstatus) which evaluates to
   one of "Public", "Backed up", "Backup pending", or
   "Not backed up" depending on the backup state of the
   commit.  Commits are pending for 10 minutes, after which
   they are declared not backed up.

2. Add a summary to the end of smartlog that shows the
   number of commits that are not backed up.

   Configuration options allow the addition of an education
   message to inform users what to do about their failing
   backups, and the message can also be suppressed.

Test Plan:
   New unit test for both the keyword and the summary.

Reviewers: #fbhgext, stash

Subscribers: mitrandir, quark, akushner

Differential Revision: https://phab.mercurial-scm.org/D184
2017-08-01 03:12:04 -07:00
Durham Goode
72f38ebdf0 fastmanifest: make usecache prevent cache creation
Summary:
Previously fastmanifest.usecache=False would only prevent the reading of the
fastmanifest cache, but the cache was still created. This created excess IO on
services that frequently recreated the repository.

Test Plan: Added a test

Reviewers: #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D155
2017-07-31 13:55:07 -07:00
Saurabh Singh
f86c1f069f stat: template which outputs diffstat-style summary of changes
Summary:
There is an existing template "diffstat" which gives a minimal and not
very useful output containing the overall number of files that changed, total
number of lines inserted for all associated files, and total number of lines
deleted for all associated files.

On the other hand, the output from the command line option "stat" is much more
descriptive. Therefore, users end up using commands of the form



  hg log -r . -T '{author}{date}' --stat



When they would have preferred something like



    hg log -r . -T '{author}{date}{stat}'



This change adds the template "stat" which will allow for the desired behavior.

Test Plan:
  # Added a new test test-template-stat.t
  # Ran arc unit

Reviewers: #sourcecontrol, quark

Reviewed By: quark

Subscribers: akushner, medson, mjpieters, quark, rmerizalde

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

Tasks: 12422741

Signature: t1:5521665:1501287682:2afaea56b3dc863c52e6300c6bc482ae132a6a61
2017-07-31 11:09:50 -07:00
Zhihui Huang
784c334b8e p4fastimport: handle race condition in git fusion commits
Summary:
When a user commits changes to a git-fusion repo, it pushes commit to perforce as user git-fusion-user, and then update the commit's author to be the actual author. We want p4fastimporter to skip the git-fusion-user commit and import the commit by the actual author. This diff sets the basic workflow, where we specify the constraint to be commits by git-fusion-user that is less than 30 seconds old.
// TODO: make the constraint configurable.

Test Plan:
$ cd ~/facebook-hg-rpms/fb-hgext/tests/
// test race condition
$ python ../../hg-crew/tests/run-tests.py test-p4fastimport-gitfusion-race-condition.t
// test all
$ python ../../hg-crew/tests/run-tests.py test-p4*

Reviewers: #idi, davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: 20141882

Signature: t1:5509536:1501521842:17dd767615b8218980eda68d4113433d30805d92
2017-07-31 11:06:31 -07:00
Stanislau Hlebik
c27f60af8e infinitepush: remove infinitepush.tempcleanworkingcopiesbackups
Summary:
This option was intended as temporary and it was enabled for long enough time.
Now let's delete it.

Test Plan: Run unit-tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D195
2017-07-31 01:00:15 -07:00
Stanislau Hlebik
b88304992e fastlog: show all hg log output even if fastlog request failed
Summary:
We had a few troubles where fastlog failed with a weird error and people got
incorrect log output. While I still don't know why fastlog failed in the first
place, I've found the reason why log output was truncated. And this diff fixes
it. See the comments in the code for details.

Test Plan: Run unit-test

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Subscribers: simonfar

Differential Revision: https://phab.mercurial-scm.org/D193
2017-07-31 00:58:55 -07:00
Kostia Balytskyi
6203a99ed4 sparse: also apply relative-path logic to --delete
Summary: Add `--delete` to the list of sparse options that understand cwd-relative paths.

Test Plan: rt

Reviewers: mjpieters, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D197
2017-07-30 08:42:40 -07:00
Kostia Balytskyi
99b1950cd9 sparse: make path absoluteness checks cross-platform
Summary: Let's be friendlier to our friends on Windows.

Test Plan: rt

Reviewers: mjpieters, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D194
2017-07-28 06:23:52 -07:00
Jun Wu
fd71c30d42 inhibit: fix date handling and add more tests
Previously, inhibit may use a wrong date when writing markers. This patch
fixes that. Also add a test to check the date and make sure `revive` takes
effects inside a transaction.

Differential Revision: https://phab.mercurial-scm.org/D182
2017-07-27 12:33:43 -07:00
Jun Wu
c68b5e5cdb pushrebase: move bookmarks as well
Differential Revision: https://phab.mercurial-scm.org/D181
2017-07-27 12:33:43 -07:00
Mateusz Kwapich
89aa9cf5dd fbamend: add unhide command for easy unhiding of commits
Summary:
This command helps the user to bring back the commits to life with an explicit
command - wihtout the need to change working copy parent or create bookmarks.

Test Plan: see test

Reviewers: #fbhgext, durham, kulshrax, quark

Reviewed By: #fbhgext, quark

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D179
2017-07-27 03:39:01 -07:00
Mateusz Kwapich
ad3ecb91d5 fbamend: add hide - a simple command for hiding commits
Summary:
We have two commands for hiding commits:
 * strip - which has a lot of legacy options and legacy name
 * prune - which allows for creating arbitrary obsolescence markers

Both of them have complicated UI and are suboptimal experiences for unadvanced
user. The `hg hide` command is very simple, does one job and does it well.

Test Plan: see test

Reviewers: #fbhgext, durham, quark, kulshrax

Reviewed By: #fbhgext, quark

Subscribers: akushner

Differential Revision: https://phab.mercurial-scm.org/D178
2017-07-27 03:39:01 -07:00
Simon Farnsworth
bb9d88ea1a githelp: don't crash when user does githelp -- git
Summary:
We didn't check for sanity when the user asked for hg githelp -- git -
oops. Fix the args test to catch you if you ask for help for git, as opposed to
(say) git commit.

Test Plan: Ran the new test cases.

Reviewers: #fbhgext, ikostia

Reviewed By: ikostia

Differential Revision: https://phab.mercurial-scm.org/D183
2017-07-26 08:51:21 -07:00
Mihails Smolins
d5c1c31862 tweakdefaults: show warnings when ':' is used to specify revs
Summary:
Wrapped _analyze parser to display developer warnings whenever ':' is used
implicitly or explicitly.

Test Plan: Added test cases

Reviewers: simonfar, durham, stash

Reviewed By: stash

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 12333181

Signature: t1:5479645:1501056920:304cbda9c0d7fe25dd600ec40c5d7540146c7889
2017-07-26 01:58:18 -07:00
Kostia Balytskyi
475c6c93fd sparse: add a config option to decide if paths are reporoot-relative
Summary:
Adding a knob to control how we perceive supplied paths is a good intermediated
step towards getting every user to use cwd-relative paths.

Test Plan: - rt

Reviewers: mjpieters, #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D175
2017-07-25 10:43:55 -07:00
Mihails Smolins
f506a362bd remotefilelog: change prefetch default behaviour
Summary:
Now hg prefetch with no revs specified by default fetches '. + draft() +
pullprefetch + bgprefetchrevs' revisions. Prefetch will block until other
background prefetches terminate.

Test Plan: Added test cases

Reviewers: durham, stash, simonfar

Reviewed By: simonfar

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 19727474

Signature: t1:5488573:1500987699:f0a12c9fdf21c52a7313182596bb89a9f710cebf
2017-07-25 06:35:16 -07:00
Jeroen Vaelen
5a8a556073 tweakdefaults: output new hashes when nodes get updated
Summary:
Users and particularly automation can benefit from having the new
revision hashes as part of the output of rebase and other operations that
update nodes. Right now, hacks such as getting the tip revision are used to get
that information.

Test Plan: unit tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce, durham, stash, quark

Differential Revision: https://phab.mercurial-scm.org/D173
2017-07-25 04:50:28 -07:00
Jeroen Vaelen
f786cd6bdb pushrebase: fix typo
Test Plan: unit tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D177
2017-07-24 11:42:24 -07:00
Lukas Piatkowski
8d71aaf0cf histedit: add --retry and --show-plan options
Summary:
--retry can be used instead of --continue when histedit failed on "exec" (due to it returning a non-zero exit code) and the user wants to repeate that command rather than continuing past it
--show-plan will print the remaining plan of histedit during an interrupted histedit

Test Plan: cd fb-hgext/tests/ && rt

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Subscribers: stash, quark

Differential Revision: https://phab.mercurial-scm.org/D176
2017-07-24 09:32:47 -07:00
Ryan McElroy
eebb039cd7 tweakdefaults: remove --nocheck flag
Summary:
Core mercurial has a much better "nocheck" option now that we should just start
using. It's better and it's built-in!

Test Plan: Updated tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D164
2017-07-24 05:37:45 -07:00
Kostia Balytskyi
6b62dd3f52 sparse: properly error out when absolute paths are used
Summary: Current behavior does not even do what it says, let alone the right thing.

Test Plan: - rt

Reviewers: #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D174
2017-07-24 02:12:37 -07:00
Jun Wu
2bb9371eef hiddenoverride: optionally log details
This allows us to log what nodes are pinned by what commands. So we can
manually investigate what was happening when we get user complaints.

Differential Revision: https://phab.mercurial-scm.org/D158
2017-07-21 10:50:30 -07:00
Stanislau Hlebik
3ea83ba4bc infinitepush: handle remotenames hoisting correctly
Summary:
There was a report from an infinitepush user who complained about
`hg update remote/scratch/book` failing to pull the bookmark, while
`hg update scratch/book` pulling fine. It confuses users because they see
`remote/scratch/book` in smartlog.

On the other hand let's not allow `hg pull -B remote/scratch/book` to stay
consistent with remotenames.

Test Plan: Slowly run tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D172
2017-07-21 08:19:59 -07:00
Mark Thomas
886a31ce5a remotefilelog: handle truncated server cache files
Summary:
If remotefilelog server cache files are truncated, when the server
returns these files to the client, the client will crash trying to
decompress them.  Detect truncated files and treat them as cache
misses.

Test Plan: Add unit test for truncated server cache files.

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D170
2017-07-21 16:07:09 +01:00
Jun Wu
35b19c0b64 uncommit: allow power users to leave an empty commit around
Some power user workflow requires `uncommit` to leave an empty commit so
they can run `hg amend` afterwards. I don't find easy alternatives so let's
allow that if `ui.allowemptyconfig` is set.

Note: `ui.allowemptyconfig` is an internal config that is not documented for
end-users. Core Mercurial seems to be trying to prevent the empty commit
case from normal users (like, comment disallows that, rebase will skip a
commit if after rebasing it becomes empty). So it seems better to still use
that undocumented config instead of a more discoverable flag.

Differential Revision: https://phab.mercurial-scm.org/D156
2017-07-21 08:06:47 -07:00
Stanislau Hlebik
932d143025 smartlog: do not draw public commits between draft commits and master
Summary:
We've seen a couple of issues when there are lots of public commits between a
head and master bookmark. Smartlog tries to draw all of the public commits
and drawing it can be too slow. See example below

```
   o - some commit that smartlog wants to draw
  /
o
.
.    -- many commits
.
o  - master bookmarks
```

This issue happens often while using infinitepush extension.
Let's fix it by drawing just one public commit between a head and master.
We could of course avoid drawing this public commit at all, but in that case
output would be smth like

```
   o - some commit that smartlog wants to draw
  /
o
|     - many commits in betwee, but user doesn't see it because there are no dots
o  - master bookmarks
```

Test Plan: Slowly run tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D168
2017-07-21 07:10:08 -07:00
Mark Thomas
03968e0663 uncommit: keep parent phase for full uncommit
Summary:
When fully uncommitting a commit on top of a public commit, uncommit
erroneously marks the new current commit with the same phase as the old
commit.  It should only do that in the case of a partial commit,
where the new current commit is a new commit.

Test Plan: Add tests to test-uncommit.t.

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D165
2017-07-21 13:27:57 +01:00
Simon Whitaker
d6b24eb1fe githelp: improve output of hg githelp -- git blame
Summary:
Adds user (-u), date (-d) and line number (-l)

If you use Phabricator, also adds Phabricator diff ID (-p)

Test Plan: run-tests.py -l test-githelp.t

Reviewers: #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: medson, mjpieters

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

Tasks: 11078001

Signature: t1:5469590:1500633342:7be15f60e371dab7016ec44866ea369c696cb0a8
2017-07-21 12:08:18 +01:00
Jun Wu
4d005373fc test-restack: add a case demonstrating restack rebase a single commit twice
The test shows that restack moves "D" twice while it could have moved it
only once. It is a side effect when I spent 1.5 hours on investigating a
user report that a commit was duplicated with `amend --rebase` somehow. I
didn't have conclusion about that report (maybe it's because old inhibit was
used?), but thought it's nice to have this interesting test case added.

If `hg rebase -r C -d B2 -q` were moved after `hg commit --amend -m B3`,
then restack will move "D" only once.

It can be solved by using another topo sort, which was planned in the
multi-dest series [1].

[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-June/100247.html

Differential Revision: https://phab.mercurial-scm.org/D163
2017-07-20 22:23:14 -07:00
Jun Wu
dc9bcdf448 hiddenoverride: be more conservative about pinning nodes
I think the code works well but it might leave unnecessary pinned nodes
around. This patch makes it more conservative so that only a movement
(update or bookmark) on an obsolete commit would write new pinned nodes.

Differential Revision: https://phab.mercurial-scm.org/D157
2017-07-20 22:22:38 -07:00
Mihails Smolins
6c06199dbb remotefilelog: add bgprefetch to update and commit
Summary:
If bgprefetchrevs is specified in config, background prefetch will be executed on
update and commit commands as well as on other commands which use update or
commit. Background prefetch will fetch revisions specified in config and if the
repack flag is set will also execute a repack.

Test Plan: Added test cases

Reviewers: simonfar, durham

Reviewed By: durham

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 19727407

Signature: t1:5454939:1500551182:e9cce84f6dc98182b5cb30faeb811fd7fa5e22b0
2017-07-20 04:54:44 -07:00
Ryan McElroy
23d1f2624d tests: update for new check-code output
Reviewed By: mitrandir
2017-07-20 03:39:08 -07:00
Stanislau Hlebik
7ebdf0f427 infinitepush: remove some unused options
Summary:
Infinitepush has too many options and many of them are unused or has never
been changed from the default value. Let's remove some of them.

Test Plan: Run infinitepush tests

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D141
2017-07-20 01:20:59 -07:00
Stanislau Hlebik
214387fb21 infinitepush: re-enable lfs support
Summary:
D17 was reverted because it broke creating bundle for non-general delta repos.
The reason is the following: D17 made infinitepush extension override
changegroup.supportedoutgoingversion() function and discard '01' version.
For non-general delta repositories it resulted in broken `hg bundle ...`
command.
`abort: repository does not support bundle version 01`

This diff fixes it by not overriding supportedoutgoingversion(). Instead
getscratchbranchpart() has its own logic of selecting changegroup version.

Test Plan:
Run unit-test
Run `hg bundle -r . --base .^ somefile` in non-general delta repo,
make sure it works fine.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D81
2017-07-20 01:14:35 -07:00
Felix Merk
782636d475 undo: file corruption handling
Basic file corruption handling: if file is corrupted, we nuke our history.
Downside is that we won't be able to undo furter back in case of a corruption,
but considering corruption this is expected.

Differential Revision: https://phab.mercurial-scm.org/D111
2017-07-19 17:49:21 -07:00
Felix Merk
82603807d7 undo: meaningful obs markers for undos
Makes obs markers for undos more meaningful.  When an undo performs a strict one
to one change, the written obs marker reflects that and the user even gets a
helpful ui message in smartlog.  One to many undos do not support such obs
markers (currently) because we can't tell splits and divergence apart easily.

Differential Revision: https://phab.mercurial-scm.org/D108
2017-07-19 17:49:21 -07:00
Felix Merk
0077b01e13 undo: add --keep to maintian working copy changes
Allow user to keep working copy changes after undo, mimicking unamend and
uncommit behavior.  As discussed at the team lunch, this allows undo to remain
ignorant of what command the user has run while conforming to user expectations.
In the future this could be done in a smarter way where we properly restore hg
status dynamically.

Differential Revision: https://phab.mercurial-scm.org/D55
2017-07-19 17:49:21 -07:00
Felix Merk
b86893cb84 undo: adds -f flag and gap edge case handling
Prevents users from accidentally crossing gaps in their history and adds an
overwride.  In most cases undoing across a gap isn't desired as the connection
between the pre and post states is unkown.  While undoing across a gap is not
destructive or inherently risky, it is inherently confusing to the user since
we don't know how many and what commands where run.  Furthermore, there is no
guarantee that the pre and post states of a gap are actually connected in any
sane way.

Differential Revision: https://phab.mercurial-scm.org/D53
2017-07-19 17:49:21 -07:00
Felix Merk
1fd69b2cab undo: implements relative undo, hg redo and tests
Implements, and makes default relative undos and adds redos.  A relative undo
behaves differently only if you haven't performend any repo changing operations
since your previous undo or redo, in which case you operate relative to that
undo/redo.  This means that a second undo will not undo the previous undo but
instead bring you furter back.

Differential Revision: https://phab.mercurial-scm.org/D52
2017-07-19 17:49:21 -07:00
Felix Merk
683f74bc3b undo: bare bones undo without tests
Adds undo command that changes working copy parent, bookmarks and
visible draft commits to a previous repo state.

Differential Revision: https://phab.mercurial-scm.org/D51
2017-07-19 17:49:21 -07:00
Adam Simpkins
6a5431e1a3 phabstatus: query conduit more efficiently for "hg log"
Summary:
Update the phabstatus code to peek ahead at revisions to be logged by
`hg log` and `hg log --graph` and query phabricator for multiple revisions at
once, rather than having to query them one at a time.

Previously it had special integration with the smartlog where it could do this
for smartlog, but not for the normal "hg log" command.

Wrapping the revset iterator this way feels somewhat hacky, but this seems like
the best way to achieve the desired results without upstream changes.  (In an
ideal world we would perhaps update the log code to process things in an
asynchronous fashion, to better support templates that may take a non-trivial
amount time to render.  Ideally the revset query would be processed in parallel
with template rendering.)

Test Plan:
Confirmed existing tests still pass, and manually tested various combinations
of `hg log`, `hg log --graph` and `hg smartlog`

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D80
2017-07-19 12:34:46 -07:00
Jun Wu
6ed0a1e206 smartlog: only count visible successors
Invisible successors could be confusing. Therefore only show visible
successors.

Differential Revision: https://phab.mercurial-scm.org/D149
2017-07-19 10:43:01 -07:00
Fano Yong
050a2705e7 pushrebase.py modification to skip cache when _data is not found
Summary: pushrebase.py modification to skip cache when _data is not found

Test Plan: hg-dev rt pushrebase*

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: mitrandir, medson, mjpieters, #mercurial

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

Tasks: 19603920

Tags: hg

Signature: t1:5367059:1500457213:d9870e1af74a4e27c1be2b08f440dc5e3f905947

Blame Revision: n/a
2017-07-19 09:09:04 -07:00
Ryan McElroy
167a834fdb undo: replace delta with base in test output
Summary:
I haven't tracked down where this change came from, but it looks fairly
benign and straightforward to fix.

Test Plan: The test now passes

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D147
2017-07-19 07:08:21 -07:00
Ryan McElroy
7cb6b2b906 pushrebase: update test after working copy update change
Summary: D123 failed to update this test as well

Test Plan: Run the test; it now passes

Reviewers: #fbhgext, stash

Reviewed By: #fbhgext, stash

Differential Revision: https://phab.mercurial-scm.org/D146
2017-07-19 07:08:21 -07:00
Ryan McElroy
f95c4e8f49 drop: fix check-code failures
Summary: These issues broke test-check-code-hg.t

Test Plan: test-check-code-hg.t now passes

Reviewers: #fbhgext, stash, simonfar

Reviewed By: #fbhgext, stash, simonfar

Differential Revision: https://phab.mercurial-scm.org/D145
2017-07-19 07:08:21 -07:00
Ola Kopczynska-Dobosz
379f8596da Adding drop command
Summary: Adding a drop extension which drops specified commit from the stack.

Test Plan: Unit tests which are part of this diff and manual testing.

Reviewers: durham, gshanbhag, #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: mitrandir, quark, #mercurial, phillco, avig, medson, mjpieters

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

Tasks: 19602078

Signature: t1:5346014:1500438430:b38acce97940fdeb7103ae70844cce71fdd79698
2017-07-18 21:57:03 -07:00
Arun Kulshreshtha
79baca1fcf fbamend: add --clean flag to hg prev/next
Summary: This patch adds a `--clean` flag to `hg prev` and `next` that discards any pending changes, similar to `hg update --clean`.

Test Plan: See included test changes.

Reviewers: #fbhgext

Differential Revision: https://phab.mercurial-scm.org/D140
2017-07-18 20:13:25 -07:00
Jun Wu
0e6e370774 hiddenoverride: avoid race condition updating the state file
Previously there is a race condition:

    origpinned = loadpinnednodes(repo)
    newpinned = ....
    with repo.lock(): # the lock might be taken by process X
        # get the lock after some time. at this time, the state file might
        # be updated by process X but we are not aware of it.
        savepinnednodes(...) # process X's change gets discarded

This patch solves that by making the write function takes a delta instead of
full content, and apply that delta inside a lock. Using repo lock is
expensive so we use a single-file lightweight flock instead.

Differential Revision: https://phab.mercurial-scm.org/D139
2017-07-18 16:07:33 -07:00
Jun Wu
2211d677b5 pushrebase: move working copy parent
When pushing the current changeset like `hg push -r . --to x`, try to update
the working copy parent.

Differential Revision: https://phab.mercurial-scm.org/D123
2017-07-18 12:16:04 -07:00
Durham Goode
18d20087f4 treemanifest: fix historypack corruption bug
Summary:
The history pack writer had a bug where if the same node was added to the
mutablehistorypack N times, it would write out that it had N entries, but then
it would only write a single entry. This caused corruption (the length value
didn't match the actual number of entries) that broke repack.

This primarily affected users who used the old version of treemanifest (where
trees were converted on the client side). The new version of treemanifest only
seems to repro this in rare cases, like when rebasing multiple commits that
create the same trees.

Test Plan: Added a test. It failed before and passes after.

Reviewers: #fbhgext, mitrandir

Reviewed By: #fbhgext, mitrandir

Subscribers: akushner

Differential Revision: https://phab.mercurial-scm.org/D128
2017-07-18 11:30:12 -07:00
Jun Wu
c1a9fbc79e undo: move undolog to vfs and mark as lock-safe
The upstream has added some warning around repo.svfs/vfs write operations
without taking locks. For undo, we don't want to take the repo lock (since
that means read-only operations like `hg log` will be blocked by another
`hg commit`). So undo has its own locking and own transaction (for lower
overhead). Therefore move all files we may write (including lock and
transaction files) to `.hg/undolog` and whitelist the directory at
`localrepository._wlockfreeprefix` to bypass the checks.

Differential Revision: https://phab.mercurial-scm.org/D112
2017-07-18 11:30:05 -07:00
Ryan McElroy
8e7158bec1 obsolete: update tests with new debugobsolete message
Summary:
Upstream change 6ddb2645abf5dced7e8e4612c8cf9d11cbf468f6 made
the debugobsolete command print out the number of changes it obsoleted.

Test Plan: run the tests

Reviewers: #fbhgext, mitrandir

Reviewed By: #fbhgext, mitrandir

Differential Revision: https://phab.mercurial-scm.org/D133
2017-07-18 10:09:28 -07:00
Ryan McElroy
99095f0b2e pushrebase: update test with fixed remotenames output
Summary:
Remotenames no longer emits this devel-warn (once some in-flight
patches are accepted, at least).

Test Plan: run the test

Reviewers: #fbhgext, mitrandir

Reviewed By: #fbhgext, mitrandir

Differential Revision: https://phab.mercurial-scm.org/D132
2017-07-18 10:09:28 -07:00
Ryan McElroy
7a5f7434d2 config: do not pass defaults to registered config items
Summary: This prevents some recently-introduced devel-warnings from breaking the tests.

Test Plan: fewer devel-warns while running tests

Reviewers: #fbhgext, mitrandir

Reviewed By: #fbhgext, mitrandir

Differential Revision: https://phab.mercurial-scm.org/D131
2017-07-18 10:09:28 -07:00
Ryan McElroy
55611588d1 bookmarks: use new applychanges api in all extensions
Summary: This eliminates the recently-added devel-warnings.

Test Plan: fewer `devel-warn`s during tests

Reviewers: #fbhgext, mitrandir

Reviewed By: #fbhgext, mitrandir

Differential Revision: https://phab.mercurial-scm.org/D130
2017-07-18 10:09:28 -07:00
Mark Thomas
9d389170da copytrace: add fast copytracing for amends 2017-07-18 08:52:20 +01:00
Felix Merk
4fdf562a93 undo: improved performance and prep for hg undo
Implements lighttransaction(repo) which improves performance of hg undo and
prevents infinite loops caused by hooks that run true hg commands.  Also adds
_getrevlog and _invertindex commands, factoring out code that will be reused.
Changes output for gaps when typing hg debugundohistory -l for slightly
better ui and clearer testing. Lastly, changes lock from repo lock to new
undolog lock and tests this.  In the future, with some changes to undo.log,
we may be able to take the lock later, bypassing the need to take it for
read-only operations.

Differential Revision: https://phab.mercurial-scm.org/D50
2017-07-17 13:18:54 -07:00
Durham Goode
81db9c874e tests: remove hard coded line from tests
Replace it with a glob
2017-07-17 04:07:27 -07:00
Stanislau Hlebik
196a16380c fastpartialmatch: fix devel.warn
Summary:
Upstream hg recently introduced new developer warning if files inside .hg are
modified without taking a lock. The usual fix is to add file in
localrepository._wlockfreeprefix list, but it doesn't work for "needrebuild"
fastpartialmatch file because it's stored inside .hg/store.
So to get rid of developer warning let's move needrebuild file to .hg/.
And since we are detecting that partial index needs to be rebuilt in revlog class,
I also had to wrap `runcommand()` and create needrebuild file there, because
`runcommand()` has vfs object, while revlog class doesn't.

Test Plan: Run tests

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D99
2017-07-17 04:03:15 -07:00
Durham Goode
bfe9c37568 tests: fix test devel-warning
Summary:
This test writes file to the vfs to indicate a hook is done. We need to tell
Mercurial that this file is ok to write outside a lock.

Test Plan: Test now passes

Reviewers: #fbhgext, simonfar

Reviewed By: #fbhgext, simonfar

Differential Revision: https://phab.mercurial-scm.org/D101
2017-07-17 04:02:43 -07:00
Mihails Smolins
9a121651cc remotefilelog: enable background prefetch for pull
Summary:
Previously prefetch on pull ran in foreground. Now it can run in background
if specified. Optionally background prefetch can be followed by background
repack.

Test Plan: Added a test case

Reviewers: simonfar, durham

Reviewed By: simonfar

Subscribers: medson, mjpieters, #mercurial

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

Tasks: 19727343

Signature: t1:5406626:1500059334:207b4100cca536cbe33f6c6dfad596d03a6fa14f
2017-07-17 03:04:22 -07:00
Sen Li
b974a7cf2c adding hg amend --to option so it amends to a specific commit
Summary: adding hg amend --to option so it can amends to a specific commit

Test Plan: will add a test for this

Reviewers: juehui, durham

Reviewed By: durham

Subscribers: medson, mjpieters

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

Signature: t1:5396805:1499986779:d555d75c636e37adbe484b5b77c1844fcacfdc86
2017-07-14 12:06:22 -07:00
Durham Goode
e3a87e44e3 pushrebase: add pack files to storage during hooks
Summary:
Hooks should run with awareness of the tree pack data, so we need to pass the
temporary pack location as part of the hook environment.

Test Plan: Added a test

Reviewers: #fbhgext, simpkins

Reviewed By: #fbhgext, simpkins

Subscribers: simpkins

Differential Revision: https://phab.mercurial-scm.org/D8
2017-07-14 11:47:12 -07:00
Durham Goode
e1b7318640 pushrebase: add config for switching to treemanifest reading
Summary:
Adds functionality and a test for when clients pushes a tree pack to the server
without any flat manifest data, and the server writes the correct flat and tree
manifests during pushrebase.

Test Plan: Added tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Subscribers: phillco, quark, dsp

Differential Revision: https://phab.mercurial-scm.org/D5
2017-07-14 11:47:12 -07:00
Durham Goode
937ee01b7d sparse: fix interaction with treemanifest
Summary:
Treemanifest relies on the matcher visitdir function, which was not implemented
in our special sparse matchers. Long term we should migrate to using the core
sparse extension. For now let's just implement visitdir().

Test Plan: Added a test. Previously the test would throw a big exception.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D84
2017-07-14 11:13:39 -07:00
Durham Goode
dc09e58efc treemanifest: allow using manifest nodes as base nodes during pack fetch
Summary:
When requesting trees from the server, the client sends a list of manifest nodes
it wants and base nodes it has, then the server sends back any parts of the tree
that are in the desired manifests but not in the base nodes. If no base nodes
are sent, then the server tries to pick appropriate base nodes from the list of
manifests being requested.

Previously, when requesting manifest X, it would only try to pick X^ as the base
node (assuming X^ was in the request set). This meant that if you requested X
and X^^, it wouldn't realize they were very similar and instead it would send
the entire X and entire X^^ trees (with lots of duplication).

With this patch, it will always use the previously requested manifest as the
base node for the next manifest, if no base nodes are specified. So requests X
and X^^ will return the minimal set of nodes.

Test Plan: Added a test.  It fails before and passes afterwards

Reviewers: #fbhgext, simpkins

Reviewed By: #fbhgext, simpkins

Differential Revision: https://phab.mercurial-scm.org/D75
2017-07-14 10:34:12 -07:00
Durham Goode
3102e456ab infinitepush: backout lfs fix
Summary: This broke hg bundle on non-generaldelta repositories.

Test Plan: Ran the tests

Reviewers: #fbhgext, stash, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D74
2017-07-13 13:53:40 -07:00
Jun Wu
0b38d6d44e hiddenoverride: unhide permanently by bookmark and working parent
We want these behaviors:

  - Checking out an obsoleted revision makes it visible even if another
    revision was checked out later
  - Putting a bookmark on an obsoleted revision makes it visible even if the
    bookmark was removed later
  - Strip/prune could make them hidden again

This is basically a lightweight version of independent hidden.

Differential Revision: https://phab.mercurial-scm.org/D70
2017-07-13 11:04:56 -07:00
Yan Yan
8e95eaafb0 Let non-existing client fail the import early
Summary: Check if the client exists, and if not, exit the import. Added a test for non-regression.

Test Plan: running test-p4fastimport-import-badclient.t

Reviewers: davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Signature: t1:5405340:1499965824:394077f0d148be2e5fef15902c69703eaf360bbb
2017-07-13 10:18:39 -07:00
Adam Simpkins
4dfe0364a6 tests: fix 'if False' statements flagged by check-code
Summary:
The check-code test in the upstream mercurial repository was recently updated
to start complaining about "if False" statements.  Two locations in fb-hgext
had this issue.

These both look to be copy-and-pastes of the same function, unfortunately.
That should probably be cleaned up too, but I'll leave that for a separate diff
for now.

Test Plan: Confirmed the test-check-code test passes now.

Reviewers: #fbhgext, durham, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D71
2017-07-12 21:29:28 -07:00
stash@fb.com
35d988093a infinitepush: handle lfs correctly
Summary:
Make sure that infinitepush work fine with lfs. To achieve it we try to use
changegroup3 if it's available and also run prepush hook before infinitepush.

Test Plan: Run `arc unit`

Reviewers: #fbhgext, quark, dsp

Reviewed By: #fbhgext, dsp

Differential Revision: https://phab.mercurial-scm.org/D17
2017-07-12 09:52:03 -07:00
Durham Goode
79639557a1 datapack: allow 'long' for metadata types
Summary:
Previously the code required that sizes be of type int. Since python plays loose
with integer types, we also need to support long.

Test Plan:
The existing test-remotefilelog-repack-fast.t test was completely
broken. It only enabled fast datapacks for the server repo, not the clients.
Enabling it for the clients as well catches this issue and verifies the fix.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D54
2017-07-11 17:02:15 -07:00
Jun Wu
ce47fb8c56 modcheck: whitelist lz4revlog
Sometimes `test-check-*` were skipped. Upon investigation, it's because
`lz4revlog` was imported and `hg` printed warnings with `modcheck`. So let's
make `lz4revlog` whitelisted.

Differential Revision: https://phab.mercurial-scm.org/D49
2017-07-11 14:42:10 -07:00
Durham Goode
f1ac312e52 tests: enable rebase.singletransaction
Summary:
Upstream rolled back the single transaction rebase by default behavior.
We still want it, so let's enabled it for all our tests.

Test Plan: Ran the tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D47
2017-07-11 13:19:40 -07:00
Durham Goode
fb90f23b77 tests: update to match upstream backup file name change
Summary: Upstream made these changes. Let's follow along.

Test Plan: Ran the tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D46
2017-07-11 13:19:40 -07:00
Mateusz Kwapich
52b1c7b246 tests: add devel-warning to remotenames output
Summary: Will be tehre until remotenames are fixed

Reviewers: quark

Reviewed By: quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D45
2017-07-11 09:44:53 -07:00
Mateusz Kwapich
fa73f071b8 tests: one new temaplate in the tests message
Summary:

Reviewers: quark

Reviewed By: quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D44
2017-07-11 09:44:53 -07:00
Mateusz Kwapich
0a6fd21b21 tests: add messages about new obsoleted changestes
Summary:

Reviewers: quark

Reviewed By: quark

Differential Revision: https://phab.mercurial-scm.org/D43
2017-07-11 09:44:53 -07:00
Mateusz Kwapich
f17c815273 tests: remove transaction aborts
Summary: Less transaction rollbacks is good, right?

Reviewers: quark

Reviewed By: quark

Differential Revision: https://phab.mercurial-scm.org/D42
2017-07-11 09:44:53 -07:00
Mateusz Kwapich
8f554eb441 tests: adjust for new messages coming from the strip transaction
Summary:

Reviewers: quark

Reviewed By: quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D41
2017-07-11 09:44:53 -07:00
Mateusz Kwapich
760d982e3e tests: change the name of backup files
Summary: Looks like the upstream has changed it on us.

Reviewers: quark

Reviewed By: quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D40
2017-07-11 09:44:53 -07:00
Mateusz Kwapich
7f61612cc8 tests: remove the warning about conflicting configs
Summary: They no longer conflict, in fact we no longer use this config in this repo.

Reviewers: quark

Reviewed By: quark

Differential Revision: https://phab.mercurial-scm.org/D39
2017-07-11 09:44:53 -07:00
Jun Wu
99386e40fd inhibit: update existing code to work with the rewritten version
Summary:
debuginhibit was removed since we no longer have a separate inhibit state.

smartlog hack about changing "o" to "x" was removed since "obsolete()"
revset is correct and the hack is unnecessary now.

directaccess was removed from tests since inhibit does not depend on it.

`- obsolete()` was added to some revsets to avoid divergence and other
surprises.

Use `inhibit.revive` API in infinitepush and reset to revive changesets
properly.

Remove various hacky code that mangle inhibit state in corner cases.

Most test changes are `o` changed to `x` in output since we draw
`obsolete()` state correctly now. `test-infinitepush-backup-remotefilelog.t`
change was because output could be `bytes/sec` instead of `KB/sec`.

Test Plan: arc unit

Reviewers: #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: kulshrax, medson, mjpieters

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

Signature: t1:5391361:1499722618:d3c1cf629f0c59ecdf1dfd5e653c1eb6176646b8
2017-07-10 15:45:31 -07:00
Jun Wu
40503c20fb inhibit: completely rewrite the extension
Summary:
The main feature we want is to be able to unobsolete an already obsoleted
changeset. The old inhibit code is causing all kinds of unsolvable weird
cases and is hard to deubg or maintain.

This patch rewrites it completely. Basically, we now require people to use
obsmarkers to "unobsolete" changesets. We treat cycles in obsstore as a
normal case and break the cycle using date information.

It should be a neat and correct solution until we want marker exchange.

A "revive" API was provided for other extensions to use.

Tests and other code changes will be fixed in a follow up.

Test Plan:
`test-inhibit.t` was rewritten to test the new features.

Other tests are broken and skipped for now. The next diff will fix them.

Reviewers: #mercurial, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters

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

Signature: t1:5391320:1499716172:a946381421cc242411f5175ee3b7a3a0bc5a4f07
2017-07-10 15:45:07 -07:00
Jun Wu
95a42790fb helper-testrepo: workaround broken helpers-testrepo.sh 2017-07-07 21:06:48 -07:00
Adam Simpkins
4a7be070d7 phabstatus: fix interaction with the smartlog extension
Summary:
Previously phabstatus.extsetup() would throw an exception if the smartlog
extension was not in use and already loaded.

This fixes the code to use extensions.afterloaded() to ensure that we try to
wrap smartlog functions only after smartlog is loaded.  It also handles the
lookup error if smartlog is not in use at all.

Test Plan: Included a new unit test.

Reviewers: #mercurial, phillco

Reviewed By: phillco

Subscribers: medson, mjpieters, net-systems-diffs@fb.com

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

Tasks: 16939242

Signature: t1:5375301:1499323251:4bc00c9cba79d60cbbb6738e8f1d648e75055cdb
2017-07-06 09:38:14 -07:00
Felix Merk
5ddcdfffe8 undo: add olddraft revset to return previous drafts
Summary: Register `olddraft([index])` revset returning draft changesets using undo data.

Test Plan: unit tests

Reviewers: stash, #mercurial, quark

Reviewed By: quark

Subscribers: mitrandir, quark, medson, mjpieters

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

Tasks: 19646287, 19261492

Signature: t1:5359322:1499122771:0a1e952a9bb4cd6b31d95a229ccb398cd6aafd1f
2017-07-03 19:01:09 -07:00
Felix Merk
ba1dce8f88 undo: deal with --hidden flag edge case
Summary:
Makes sure repo is filtered by the "visible" filter which hides hidden commits.
Otherwise --hidden flag can mass up "draftheads" storage.

Test Plan: Added a new test case.

Reviewers: #mercurial, quark

Reviewed By: quark

Subscribers: quark, medson, mjpieters

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

Tasks: 19822306

Signature: t1:5357222:1499102417:ce78065d36841601fe0dfb1d615d7b3be28c5870
2017-07-03 19:01:09 -07:00
Felix Merk
955a9bfcce undo: allow user to list or see details about undoable commands run
Summary: add hg debugundohistory -l to view recent undoable transactions

Test Plan: unit test

Reviewers: #mercurial, stash, quark

Reviewed By: quark

Subscribers: quark, mitrandir, durham, stash, medson, mjpieters

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

Tasks: 19646287

Signature: t1:5325772:1499122626:48dd25cee8ed8912c07a6c1dabb3d4286483a8b7
2017-07-03 19:01:09 -07:00
Jun Wu
605fa025ff morecolors: colorize uncaught exceptions
Summary:
Previously morecolors only changes "ui.traceback". This diff makes it replace
uncaught exceptions. It now conflicts with errorredirect (whichever loads last
will be effective) but that's probably fine since morecolors is intended for
the team only.

Test Plan: Added a test case.

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: mitrandir, medson, mjpieters

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

Signature: t1:5347030:1498751985:b8c750c5bfe4a25f1e0a4dd1cebcfa74fa8739b0
2017-06-29 09:55:25 -07:00
Felix Merk
1abcb63689 undo: amend transacts twice
Summary: amend performs two transactions, second without command which breaks our assertion, but possibly isn't an issue. This fixes the assertion.

Test Plan: unit tests

Reviewers: #mercurial, stash, quark

Reviewed By: quark

Subscribers: quark, stash, medson, mjpieters

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

Tasks: 19261492

Signature: t1:5326358:1498684945:0fde1df243cdbac67ceb092d30599ebd56a731a5
2017-06-28 15:28:40 -07:00
Therin Irwin
66b64d8fb6 fbamend: change hint text to suggest running restack
Summary: Instead of referencing `hg rebase` --restack option, just reference the `restack` subcommand.

Test Plan:
1. Make a few commits 1, 2, 3, 4 on any branch
2. `hg update 1`
3. Try to amend commit 1
4. Warning message should appear about children left behind
expected: Hint text does not mention `hg rebase --restack`

Reviewers: durham, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters, kkrewink

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

Tasks: 19601780

Signature: t1:5313108:1498249314:98f31f4424341ef51997687293bf99b7297b6cd0
2017-06-26 07:31:28 -07:00
Stanislau Hlebik
a5b66da81e infinitepush: cleaning up
Summary:
Inspired by @mjpieters comments to another diff.
Let's simplify error handling.

Test Plan: arc unit

Reviewers: #mercurial, mjpieters, quark

Reviewed By: quark

Subscribers: quark, medson, mjpieters, #sourcecontrol

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

Signature: t1:5310421:1498248385:4957c187e99ed112db388fd3e3daf115c0fe9e0f
2017-06-26 00:55:16 -07:00
Stanislau Hlebik
f9c6290c1b infinitepush: log number of added heads
Summary: It's a useful piece of information for Mononoke (see attached task).

Test Plan: arc unit

Reviewers: #mercurial, jsgf

Reviewed By: jsgf

Subscribers: medson, mjpieters

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

Tasks: 18812931

Signature: t1:5310026:1498234999:0c06a30bd659d6a1d3cedc28252f17dd1fc93dc8
2017-06-26 00:42:03 -07:00
Jun Wu
14440f1fcf tweakdefaults: add bookmark -D support
Summary:
It got removed from inhibit by D5258813. It's a useful feature so let's
re-implement it in tweakdefaults.

Test Plan: Added test cases with plain strip and fbamend's safe strip.

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: medson, mjpieters

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

Signature: t1:5313291:1498321590:03e61a5b1acc2df44afcfd6ceb723e17c648ce79
2017-06-24 23:18:52 -07:00
Felix Merk
fbd87d6923 undo: store op history
Summary: Store basic operational history: bookmarks, commands, private heads, date and working copy parent

Test Plan: Unit tests

Reviewers: durham, #mercurial, mitrandir, quark

Reviewed By: quark

Subscribers: stash, mitrandir

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

Tasks: 19261492, 19563903, 19450726

Tags: Hg Undo

Signature: t1:5293596:1498245082:264e344054ee5061a439dec1c6071c2a60ffcf55
2017-06-23 12:19:09 -07:00
Stanislau Hlebik
a2c98b25a6 infinitepush: do not fail if backup state file does not exist
Summary:
Previously pushbackups failed when it tried to unlink non-existent infinitepush
backup state file. This diff fixes it.

Test Plan: arc unit

Reviewers: #mercurial, mitrandir

Reviewed By: mitrandir

Subscribers: medson, mjpieters, #sourcecontrol

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

Signature: t1:5309684:1498210504:49af716dbb4e7e1875e8a2b7ee4b40fe28ceefc1
2017-06-23 03:27:49 -07:00