sapling/eden/scm/tests/test-fb-hgext-remotefilelog-commit-repack-t.py
Jun Wu 856e8ab3ef setdiscovery: reimplement findcommonheads without Python DAG deps
Summary:
Re-implement the `findcommonheads` logic using `changelog` APIs that are going
to have native support from Rust.

This decouples from revlog-based Python DAG logic, namely `dagutil.revlogdag`,
and `ancestor.incrementalmissingancestors`, unblocking Rust DAG progress, and
cleans up the algorithm to not use revision numbers.

The core algorithm is unchanged.  The sampling logic is simplified and tweaked
a bit (ex. no 'initial' / 'quick initial' special cases). The debug and
progress messages are more verbose, and variable names are chosen to match
the docstrings.

I improved the doc a bit, and added some TODO notes about where I think can be
improved.

Reviewed By: sfilipco

Differential Revision: D22519582

fbshipit-source-id: ac8cc8bebad91b4045d69f402e69b7ca28146414
2020-07-30 20:32:30 -07:00

35 lines
998 B
Python

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % ". $TESTDIR/library.sh"
sh % "hginit master"
sh % "cd master"
sh % "setconfig 'remotefilelog.server=True'"
sh % "cd .."
sh % "hgcloneshallow ssh://user@dummy/master client" == r"""
streaming all changes
0 files to transfer, 0 bytes of data
transferred 0 bytes in 0.0 seconds (0 bytes/sec)
no changes found
updating to branch default
0 files updated, 0 files merged, 0 files removed, 0 files unresolved"""
sh % "cd client"
sh % "setconfig 'remotefilelog.commitsperrepack=1'"
sh % "echo x" > "x"
sh % "hg commit -Am x" == r"""
adding x
(running background incremental repack)
(running background incremental repack)
(running background incremental repack)"""