Commit Graph

659 Commits

Author SHA1 Message Date
Mark Thomas
2908eadaa8 conflictinfo: handle path conflicts
Upstream recently added path conflicts as a concept.  Update the
conflictinfo extension to understand and show path conflicts.

Path conflicts are different to other kinds of conflicts, so appear
in a separate list in the form:

    "pathconflicts:" [{
        "path": "path/to/directory",
        "fileorigin": "local",   # or "remote"
        "renamedto": "path/to/renamedfile"
    }]

Differential Revision: https://phab.mercurial-scm.org/D1051
2017-10-13 06:59:27 -07:00
Mark Thomas
fc656972e0 sparse: fix for upstreamed path conflicts changes
Differential Revision: https://phab.mercurial-scm.org/D1050
2017-10-13 06:59:27 -07:00
Mark Thomas
b5903c56c2 fbhistedit: add graft histedit action
Add a new `histedit` verb: `graft`.  This allows grafting (copying) of
changesets from outside of the history that is being edited, using the
node hash of the other changeset.

The other changeset is left intact - its contents are duplicated in a new
changeset.

The other changeset must not be one of the changesets that are being
edited as part of the histedit.

Differential Revision: https://phab.mercurial-scm.org/D1025
2017-10-13 04:05:55 -07:00
Pulkit Goyal
7e0360a6af uncommit: drop the extension from fb-hgext as it was moved to core
This patch drops the uncommit extensions which has been moved to core. The
in-core extension does not allow bare `hg uncommit` on dirty working directory.
One need to set `experimental.uncommitondirtywdir = True` to do `hg uncommit` on
dirty working directory.

So this patch also set the required config to True in tweakdeafults.py to
maintain the behaviour.

Differential Revision: https://phab.mercurial-scm.org/D751
2017-10-13 12:15:20 +05:30
Adam Simpkins
db0d906e58 sparse: don't crash in non-sparse repositories
Summary:
Update the workingfilectxdata() to check that this is actually a sparse
repository before trying to call repo.sparsematch()

Test Plan: Update the test to confirm that "hg diff" works instead of crashes now.

Reviewers: #fbhgext, mbthomas

Reviewed By: #fbhgext, mbthomas

Differential Revision: https://phab.mercurial-scm.org/D1023
2017-10-12 14:08:50 -07:00
Phil Cohen
460b83af69 tests: fix last patch 2017-10-12 11:53:12 -07:00
Phil Cohen
ed9142ddaa smartlog: default to 2.
5414d0cfdcb8 registers this config, so we need to provide a default.
2017-10-12 09:33:25 -07:00
Zhihui Huang
ba9a6009ff p4fastimporter: optimize sync import - do not write dup filelogs
Differential Revision: https://phabricator.intern.facebook.com/D5966218
2017-10-11 17:49:48 -07:00
Zhihui Huang
b49a8c00b7 p4fastimporter: add helper function in importer
Differential Revision: https://phabricator.intern.facebook.com/D5966216
2017-10-11 17:49:21 -07:00
Phil Cohen
40807555e3 obbshelve: remove defaults to shelve.maxbackups
Conflicts with 83435cb229c0 which obviates it.

Differential Revision: https://phab.mercurial-scm.org/D995
2017-10-10 13:42:44 -07:00
Zhihui Huang
a6d5ff8f57 p4fastimport: fix sync commit - complete workflow
Differential Revision: https://phabricator.intern.facebook.com/D5966213
2017-10-10 10:14:00 -07:00
Zhihui Huang
e4f962c4d2 p4fastimport: refactor getfilelist
Differential Revision: https://phabricator.intern.facebook.com/D5966150
2017-10-10 10:13:41 -07:00
Zhihui Huang
a8c21c177d p4fastimporter: refactor relpath
Differential Revision: https://phabricator.intern.facebook.com/D5966024
2017-10-10 10:13:19 -07:00
Zhihui Huang
d0858c8680 p4fastimporter: add p4 helper functions
Differential Revision: https://phabricator.intern.facebook.com/D5966018
2017-10-10 10:09:20 -07:00
Jun Wu
7d03a0edc7 fastannotate: be compatible with upstream change 2017-10-05 10:44:08 -07:00
Durham Goode
1a4d39cf37 checkcode: remove unnecessary 'pass' statements
Upstream hg added a check code rule to remove unnecessary 'pass' statements.
2017-10-04 18:55:07 -07:00
Durham Goode
9e2f53f243 drop: don't pass rev number to cleanupnodes
Drop was passing a rev number to cleanupnodes, which isn't supported.  New
versions of hg throw an exception when this happens, so this was caught by the
tests.
2017-10-04 18:47:11 -07:00
Jun Wu
7b4cb726fc tweakdefaults: be compatible with upstream change 2017-10-04 18:38:45 -07:00
Phil Cohen
c7a834f395 perftweaks: fix a bad merge 2017-10-04 18:06:45 -07:00
Phil Cohen
82f05b3c75 sqldirstate: remove
We no longer use this experiment and the upstream refactor breaks it. Let's remove it.

Test Plan:
all sqldirstate tests pass now

Differential Revision: https://phab.mercurial-scm.org/D944
2017-10-04 17:53:40 -07:00
Durham Goode
99b280abb8 perftweaks: update to match upstream dirstate._map refactor
Upstream has refactored the dirstate, so we need to update perftweaks.
2017-10-04 17:49:01 -07:00
David Soria Parra
a52fe379df p4fastimport: fix resetting file flags
When a file changed to include a flag and then the flag is removed we did not
correctly remove the flag. We now correctly set flags for all revisions.

Differential Revision: https://phab.mercurial-scm.org/D920
2017-10-04 12:57:27 -07:00
Ryan McElroy
56bc2afcf0 tweakdefaults: add abort flag for colon revset
Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Subscribers: quark

Differential Revision: https://phab.mercurial-scm.org/D904
2017-10-03 02:09:23 -07:00
Stanislau Hlebik
07b4213604 sparse: fix check-commit test 2017-10-01 05:45:27 -07:00
Shravya Reddy Kuchikulla
3c9328d1ee sparse: add a --cwd-list option
This diff adds an option --cwd-list to hg sparse. This will return the
contents of the current directory.  The files that are in the sparse profile are
annotated with a '-' indicator.

Test Plan:
Tested by running the command 'hg sparse --cwd-list' in various folders.

Differential Revision: https://phab.mercurial-scm.org/D731
2017-10-01 05:45:27 -07:00
Diego Caballero
60ea7b5141 hg update hint
Differential Revision: https://phab.mercurial-scm.org/D834
2017-09-28 11:30:37 -07:00
Ryan McElroy
1ac1a987b3 fbamend: fix typo and shorten advice
Summary: Shorter and sweeter and hopefully more correct.

Reviewers: #fbhgext, mjpieters

Reviewed By: mjpieters

Subscribers: mjpieters

Differential Revision: https://phab.mercurial-scm.org/D827
2017-09-27 06:43:51 -07:00
Ryan McElroy
b20938c285 tweakdefaults: explicitly enable/disable single colon warning
Summary:
I think this is a better way of surfacing this warning. It also allows
us to tweak the message so we can point at new documentation I have already
written up.

Test Plan: Updated test

Reviewers: #fbhgext, mbthomas, durham, singhsrb

Reviewed By: #fbhgext, mbthomas, durham, singhsrb

Subscribers: singhsrb, quark

Differential Revision: https://phab.mercurial-scm.org/D812
2017-09-27 14:05:56 +01:00
Jun Wu
de4b9b241c hiddenoverride: do not resolve obsoleted revisions during startup
Resolving obsoleted revisions (`repo.revs('obsolete()')`) is slow. Let's
move that filtering logic from read code path to write code path. So it does
not get executed for every command.

Test Plan:
`hg bookmark --hidden --profile`. Make sure obsstore loading logic
disappears from the profiling output.

Differential Revision: https://phab.mercurial-scm.org/D806
2017-09-26 13:34:34 -07:00
Jun Wu
0578f57460 p4fastimport: do not break other extensions
p4fastimport's reposetup will break other lfs commands or verify. Let's
limit that side effect to p4fastimport related commands. So they won't
affect users with p4fastimport enabled.

Differential Revision: https://phab.mercurial-scm.org/D801
2017-09-26 13:34:34 -07:00
Mark Thomas
a44fc44f24 sparse: add --sparse option to hg diff
Add a --sparse option to `hg diff` which filters the diff to include only files
that are part of the sparse profile.

When files are moved or copied across the sparse profile boundary, they will
show as added or removed (for moves) in the diff.  This is the same behaviour
as `hg diff --root`.

Test Plan:
Expand `tests/test-sparse-diff.t`

Differential Revision: https://phab.mercurial-scm.org/D797
2017-09-26 03:24:56 -07:00
Mark Thomas
b0c997501c sparse: get data for excluded files from working copy parent
When commands like 'diff' request the contents of files from a workingfilectx,
normally this is satisfied by reading from disk.  For files outside the sparse
checkout this doesn't work, so instead we must return the content from the
working copy parent.

Test Plan:
`tests/test-sparse-diff.t`

Differential Revision: https://phab.mercurial-scm.org/D788
2017-09-26 03:24:56 -07:00
David Soria Parra
11a84b900f p4fastimport we must return the value from the function we are decorating
We must correctly return the value from the function we are decorating.

Test Plan:
run tests

Differential Revision: https://phab.mercurial-scm.org/D767
2017-09-25 15:34:17 -07:00
Saurabh Singh
92177b3187 tweakdefaults: add config to enable/disable developer warnings
Summary:
Adding a config to control (only enable/disable for now) developer
warnings. This allows disabling the warnings on platforms like servers.

Test Plan: Updated and ran test-tweakdefaults.t

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Differential Revision: https://phab.mercurial-scm.org/D802
2017-09-23 16:58:58 -07:00
Jun Wu
99a01a0dbd dirsync: respect rule order
With rules of nested paths, the order of rules matters.

Note: this does not make dirsync handle recursive changes. i.e. a mirror
from path1 to path2 won't trigger a rule matching path2.

Differential Revision: https://phab.mercurial-scm.org/D770
2017-09-21 15:57:11 -07:00
Jun Wu
415f5074b3 undo: do not run undolog for every command
Previously, undolog runs for every command, which sometimes adds unwanted
noticeable overhead like `hg status` with a large obsstore. This patch makes
undo smarter to only log commands that actually write things.

This is done by making undolog only run for transactions, updates (legacy
code that does not require a transaction). Tests are changed to reflect
`hg status` does not trigger undolog, and the new code seems to work better
with chg.

Differential Revision: https://phab.mercurial-scm.org/D739
2017-09-21 14:38:43 -07:00
Martijn Pieters
7225395555 Linting fixes, remove usused import and safehasattr
Differential Revision: https://phab.mercurial-scm.org/D765
2017-09-21 08:07:09 -07:00
Stanislau Hlebik
7e37af474c fbconduit: add timeout
Summary:
Just as in phabricator/conduit.py. It is necessary for D620

BTW, not sure why do we have very similar code in two places.

Test Plan: Will be tested in D620

Reviewers: #fbhgext, shivramk, mitrandir

Reviewed By: #fbhgext, mitrandir

Differential Revision: https://phab.mercurial-scm.org/D742
2017-09-21 07:01:27 -07:00
Mateusz Kwapich
abb9347d10 metaedit: make it compatible with histedit
Summary:
auto-rebasing stuff during metaedit doesn't really work well for histedit.
Let's specialcase it

Test Plan: see test

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Subscribers: ryanmce

Differential Revision: https://phab.mercurial-scm.org/D747
2017-09-21 05:33:54 -07:00
David Soria Parra
d6a9a2bcaa lfs: implement remotefilelog prefetch
When calling prefetch in remotefilelog, also prefetch lfs
files.

We are using the same hook mechanism that remotefilelog is already using
for LFS by having remotefilelog call into LFS.

Test Plan:
run tests on test-lfs-remotefilelog-prefetch.t

Differential Revision: https://phab.mercurial-scm.org/D732
2017-09-20 14:02:58 -07:00
Mateusz Kwapich
5c80b1b5fe [prune] advertise "hg hide"
Summary: "hg hide" is the user friendly command for hiding commits

Test Plan: ran tests

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D725
2017-09-20 07:55:56 -07:00
Aaron Shotkin
0d2cd6bff2 p4fastimport: used retry decorator
Summary: added in references to replace the broken references to retries

Test Plan: run https://phabricator.intern.facebook.com/P58253036

Reviewers: davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: T21960796

Tags: bootcamp

Signature: 5866393:1505861463:ec22714d52586d5c42df80fd291712d2d9dc2895
2017-09-19 15:57:33 -07:00
Aaron Shotkin
3c316aa224 p4fastimport: added retry decorator
Summary: added a new decorator that will replace the broken retries function

Test Plan: run https://phabricator.intern.facebook.com/P58253036

Reviewers: davidsp

Reviewed By: davidsp

Subscribers: medson, mjpieters

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

Tasks: T21960796

Tags: bootcamp

Signature: 5866346:1505861561:c633d79b6485333b4b8a6ae9201ff3b59a3a6d05
2017-09-19 15:57:33 -07:00
Saurabh Singh
c2bf4500f9 gitlookup: reorganising the imports
Summary:
Reorganising the imports in the file gitlookup.py to comply with the
recommended way.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D702
2017-09-13 17:17:55 -07:00
Saurabh Singh
bf363c4fd9 gitlookup: using util.urlreq instead of importing urllib
Summary:
I was reorganising the imports of gitlookup.py. After reorganising, the test
test-check-code-hg.t was probably able to recognise the imports and suggested
that we should using util.urlreq instead of urllib. Therefore, I am making the
suggested change in this commit and removing the urllib dependency.

I will be reorganising the imports in a later commit.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D701
2017-09-13 17:17:55 -07:00
Saurabh Singh
5106edcb35 gitgetmeta: enable serving only missing hg-git map data
Summary:
The gitlookup extension allows for only requesting the complete file
from the server. This leads to download of large files (hg-git map file
specifically in this case) when only the missing chucks of the file would have
sufficed.

This commit makes changes to allow for downloading only the missing parts of
the map file. A config option 'onlymapdelta' has also been added to allow for
switching between the two different modes of operation: serving complete file
and serving only the missing chunks. The tests were subsequently updated to
cater to the new scenario and also, checking for interoperability of the two
modes.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D695
2017-09-13 17:17:55 -07:00
Saurabh Singh
6da8dca955 gitlookup: creating description for the extension
Summary:
There is no description of the 'gitlookup' extension when 'hg help
gitlookup' in invoked. I just changed the existing code comments to form a
description.

Test Plan: Checked output of 'hg help gitlookup'

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Differential Revision: https://phab.mercurial-scm.org/D693
2017-09-13 17:17:55 -07:00
Saurabh Singh
3c0deb116c gitgetmeta: refactor code in gitlookup.py
Summary:
This commit just refactors some code to setup nicely for handling a
new type of bundle part. The refactoring essentially moves out the parts that
can be reused later.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Differential Revision: https://phab.mercurial-scm.org/D692
2017-09-13 17:17:55 -07:00
Phil Cohen
c259f16e35 copytrace: update _filemerge signature, add wctx
I changed this in D449 to add wctx to _filemerge.

Differential Revision: https://phab.mercurial-scm.org/D700
2017-09-13 14:24:49 -07:00
Durham Goode
b5deda8de4 changegroup: update to match upstream makechangegroup change
Upstream has refactored the changegroup creation APIs so we need to update our
usages.
2017-09-12 10:10:06 -07:00