Commit Graph

682 Commits

Author SHA1 Message Date
Pulkit Goyal
0e479f3794 pushvars: move config setting in tweakdefaults and drop the extension
The logic of pushvars extension was moved to core and the extension here just
used to set a config which defaults to False in core. Let's move that config
setting to tweakdefaults and drop the extension.

Differential Revision: https://phab.mercurial-scm.org/D1275
2017-11-01 01:41:55 +05:30
Phil Cohen
bef53b0ff4 rage: include contents of packdirs
Example output:
```
shared packs (files):
---------------------------
/var/cache/hgcache/fbsource/packs:
total 64K
drwxrwsr-x. 2 phillco svnuser 36K Oct 26 14:09 manifests
...

shared packs (trees):
---------------------------
/var/cache/hgcache/fbsource/packs/manifests:
total 741M
-r--r--r--. 1 phillco svnuser 1.8K Oct  9 00:37 0a0d759b468bf3766b1596d133d7dcf5c55db702.dataidx
-r--r--r--. 1 phillco svnuser  77K Oct  9 00:37 0a0d759b468bf3766b1596d133d7dcf5c55db702.datapack
-r--r--r--. 1 phillco svnuser  33K Oct  9 12:54 0b233c54960ad32a75238334b18bdb8176b95dae.dataidx
-r--r--r--. 1 phillco svnuser 1.7M Oct  9 12:54 0b233c54960ad32a75238334b18bdb8176b95dae.datapack
-r--r--r--. 1 phillco svnuser  74K Oct  8 23:40 0b33a64b257bee2583ded9d38f13404f52a33670.dataidx
...

local packs (files):
---------------------------
/data/users/phillco/fbsource/.hg/store/packs/:
total 856K
drwxrwsr-x. 2 phillco svnuser 856K Oct 26 14:14 manifests


local packs (trees):
---------------------------
/data/users/phillco/fbsource/.hg/store/packs/manifests:
total 27M
-r--r--r--. 1 phillco svnuser 1.2K Oct  3 13:37 000004931915fa871abb373503d0e8656f543d59.dataidx
-r--r--r--. 1 phillco svnuser 4.4K Oct  3 13:37 000004931915fa871abb373503d0e8656f543d59.datapack
-r--r--r--. 1 phillco svnuser 1.2K Oct  3 13:34 0009e3182c6268d64a3c6d9cb79ba74a0f5e3fa2.dataidx
-r--r--r--. 1 phillco svnuser 3.1K Oct  3 13:34 0009e3182c6268d64a3c6d9cb79ba74a0f5e3fa2.datapack
...
```

Differential Revision: https://phab.mercurial-scm.org/D1261
2017-10-30 20:48:06 -07:00
Durham Goode
f64fb99447 pushrebase: fix support for tree manifests
pushrebase can't use the standard rev.manifest() or rev[filepath] accessors
because they aren't aware of treemanifests. Let's refactor our manifest and
filectx accessor patterns into a separate function and use it in the two places
that need manifests.

test-treemanifest-server.t was failing before this. One test was modified
because the does-it-have-the-tree check is now done earlier, before the lock is
taken, so we abort before the output is printed.

Differential Revision: https://phab.mercurial-scm.org/D1251
2017-10-26 14:29:55 -07:00
Mark Thomas
7098f7d4b5 pushrebase: check sources of renames when looking for conflicts
When checking the bundle contents against the revisions it is being rebased
over, include the sources of renames, as changes made in those files also
conflict with the bundle.

Differential Revision: https://phab.mercurial-scm.org/D1199
2017-10-26 02:47:39 -07:00
Phil Cohen
ca7d60b943 conflictinfo: add more information about the conflict-causing command
In the old version of this extension it was too difficult to determine how to
resume or abort the command that generated conflicts. Let's add that
information so consumers can programatically continue or abort.

Differential Revision: https://phab.mercurial-scm.org/D713
2017-10-25 22:20:32 -07:00
Mateusz Kwapich
0db7fe6449 crdump: fix the binary file dumping on windows
Summary:
Stupid bug corrupted files with extra \r on windows.

From python manual:



>On Windows, 'b' appended to the mode opens the file in binary mode, so there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a distinction between text and binary files; the end-of-line characters in text files are automatically altered slightly when data is read or written. This behind-the-scenes modification to file data is fine for ASCII text files, but it’ll corrupt binary data like that in JPEG or EXE files. Be very careful to use binary mode when reading and writing such files. On Unix, it doesn’t hurt to append a 'b' to the mode, so you can use it platform-independently for all binary files.


Test Plan: the crdump tests should now pass on windows as well (didn't actually run them on Windows because I don't really know how)

Reviewers: #mercurial, rmcelroy, ikostia, medson

Reviewed By: medson

Subscribers: mjpieters, medson

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

Tasks: T23027803

Signature: 6151931:1508964509:65806961cbde26884cd45def17767135ceeac05f
2017-10-25 13:59:24 -07:00
Durham Goode
13b21a28eb configs: remove config defaults for registered configs 2017-10-24 17:54:02 -07:00
Durham Goode
f260c80298 configs: register more of our configs
Upstream has added devel warnings that require us to register all the configs
and remove the defaults that are specified at read time. This doesn't fix all
the cases, but is the start.

Differential Revision: https://phab.mercurial-scm.org/D1206
2017-10-23 20:02:57 -07:00
Durham Goode
6db0ad3d03 config: rename allowdivergence to evolution.allowdivergence
Upstream has renamed this config. Since the old config name was still an alias
for the new name, it was technically only breaking the test output where we
hardcoded the config name in the output. But I went ahead and updated every
place anyways.

Differential Revision: https://phab.mercurial-scm.org/D1209
2017-10-23 19:31:43 -07:00
Durham Goode
7600b6f0d5 smartlog: fix wrapping of _show
Upstream has added a new parameter, so let's wrap it more generically.

Differential Revision: https://phab.mercurial-scm.org/D1207
2017-10-23 19:31:43 -07:00
Stanislau Hlebik
808ae58590 pushrebase: handle pushing phases through separate bundle2 part
In 272dd7d8a1bb1b2e93697b5b65183b08c8bf0853 upstream hg commit phase pushes
started to use separate bundle2 part. Because of that:
1) pushkey hook is not called when updating phases.
2) pushkey bundle2 part doesn't process phases anymore, 'phase-heads' part do
it instead.

It caused breakages in pushrebase. This diff fixes it.

Test Plan:
Run tests test-pushrebase*  and test-treemanifest*

Differential Revision: https://phab.mercurial-scm.org/D1204
2017-10-23 10:36:16 -07:00
Stanislau Hlebik
1eebe223d0 tests: register some config options
Previously test-treemanifest-treeonly.t was hanging. Now it doesn't hang (but
still fails).

It obviously doesn't fix the real issue, but at least it doesn't make test
hang.

Test Plan:
Run test-treemanifest-treeonly.t

Differential Revision: https://phab.mercurial-scm.org/D1205
2017-10-23 10:07:38 -07:00
Martijn Pieters
0c66c99dcd phabricator: pass in the cacerts file if configured
Some environments configure a separate certificate store, and SSL connections
can fail if the wrong store is auto-discovered or no store exists.

This makes the client tied to the specific certificates used, so update the
client cache to key on the ca_certs value passed in.

Differential Revision: https://phab.mercurial-scm.org/D1194
2017-10-19 14:03:48 +01:00
Jun Wu
06b664a1b9 edrecord: workaround configitem devel-warn 2017-10-17 13:05:18 -07:00
Jun Wu
7775848489 codemod: use pycompat.is* to check platforms
This solves check-code issues:

  fastmanifest/concurrency.py:144:
   > if platform.system() == 'Windows':
   don't use platform.system(), use pycompat
  hgext3rd/extutil.py:15:
   > if platform.system() == 'Windows':
   don't use platform.system(), use pycompat
  remotefilelog/basepack.py:44:
   > if pycompat.osname == 'posix':
   use pycompat.isposix
2017-10-17 13:05:18 -07:00
Saurabh Singh
73f2ea65a0 fbhistedit: removing the experimental config 'histeditng'
Summary:
The config 'histeditng' was removed in upstream recently and is
therefore, no longer required. This commit removes the config and fixes some
tests which were dependent on it.

Test Plan: Ran all the tests.

Reviewers: #fbhgext, quark

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D1118
2017-10-17 11:56:27 -07:00
Jun Wu
3a2db13cb1 fbsparse: reapply D1050 to the renamed file
D1050 got lost by landing D1048 via pushrebase, because pushrebase does not
check the source of copied files.

The graph looks like:

  o  D1048 sparse: rename to fbsparse  (after pushrebase)
  o  D1050 mbthomas sparse: fix for upstreamed path conflicts changes
  | x  D1048 sparse: rename to fbsparse  (before pushrebase)
  |/
  o
  |
  ~
2017-10-16 17:53:16 -07:00
Pulkit Goyal
4b12e3fa7c fold: use scmutil.cleanupnodes()
Differential Revision: https://phab.mercurial-scm.org/D1039
2017-10-17 03:56:15 +05:30
Pulkit Goyal
9e5aa0d659 tweakdefaults: add capability to skip some commands in cleanupnodes wrapper
The goal to show hash changes is to add support for json output printing full
hashes to increase support for automation and Nuclide. To achieve the goal in
best and clean way, we must use formatter. So support of using formatter and
having json output for commands will be added to commands. Since for those
commands we don't need this wrapper, lets add a functionality to skip the
wrapper for some commands.

We need to update the set introduced in this patch for each command we add
support to show hash changes.

Differential Revision: https://phab.mercurial-scm.org/D1038
2017-10-17 03:56:15 +05:30
Adam Simpkins
e00022c00d phrevset: fix code that was returning commit strings
Summary:
Fix another code path in phrevset that could incorrectly return commit strings
instead of rev numbers.

Test Plan:
Manually tweaked phrevset to force it to hit this code path (to ensure it would
not find the commit from the local log walk first), and confirmed it now
returned a rev ID instead of commit strings.

Reviewers: #fbhgext, quark, durham

Reviewed By: #fbhgext, quark

Differential Revision: https://phab.mercurial-scm.org/D684
2017-10-16 12:55:16 -07:00
Catherine Gasnier
796266c8c5 hg show --stat should not show patch
Summary: show extension: 'hg show --stat' should not show patch, just like 'git show --stat'
Test Plan: test-show.t
'hg show --stat' shoes diffstat, not patch
'hg show' shows patch, but no stat
Reviewers: rmcelroy,phillco
Subscribers: ianj
Tags:
Tasks: 22546204
Blame Revision:
2017-10-16 02:07:53 -07:00
Ryan McElroy
5e93d8bd89 obsshelve: register maxbackups config
Summary:
Renaming this config to `obsshelve.maxbackups` for now eliminates the overlap with the
`shelve.maxbackups` config and fixes the root problem that D995 was trying to solve.

Reviewers: #fbhgext, durham

Reviewed By: #fbhgext, durham

Subscribers: durham

Differential Revision: https://phab.mercurial-scm.org/D1054
2017-10-16 01:58:29 -07:00
Jun Wu
87e672961e sparse: rename to fbsparse
This avoids conflict with the core extension (`hgext/sparse.py`). In
development mode, the `hgext` version takes precedence and people can easily
use the wrong sparse extension.

`sparse.py` is kept for compatibility.

Differential Revision: https://phab.mercurial-scm.org/D1048
2017-10-13 14:51:27 -07:00
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