mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
f42333f17c
Summary: Formats a subset of opted-in Python files in fbsource. Black formatting was applied first, which is guaranteed safe as the AST will not have changed during formatting. Pyfmt was then run, which also includes import sorting. The changes from isort were manually reviewed, and some potentially dangerous changes were reverted, and the directive was added to those files. A final run of pyfmt shows no more changes to be applied. Reviewed By: zertosh Differential Revision: D24101830 fbshipit-source-id: 0f2616873117a821dbc6cfb6d8e4f64f4420312b
32 lines
849 B
Python
32 lines
849 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
|
|
|
|
|
|
# Setup the repository
|
|
|
|
sh % "hg init myrepo"
|
|
sh % "cd myrepo"
|
|
sh % "mkdir -p foo/bar-test foo/bartest"
|
|
sh % "echo a" > "foo/bar-test/a.txt"
|
|
sh % "echo b" > "foo/bartest/b.txt"
|
|
sh % "hg add ." == r"""
|
|
adding foo/bar-test/a.txt
|
|
adding foo/bartest/b.txt"""
|
|
sh % "hg commit -m Init"
|
|
|
|
sh % "mkdir foo/bar"
|
|
sh % "echo c" > "foo/bar/c.txt"
|
|
sh % "hg add ." == r"""
|
|
adding foo/bar/c.txt"""
|
|
sh % "hg commit -m 'Add foo/bar/c.txt'"
|
|
|
|
sh % "hg diff -r .^ -r . --stat" == r"""
|
|
foo/bar/c.txt | 1 +
|
|
1 files changed, 1 insertions(+), 0 deletions(-)"""
|