Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/sapling-cli-getdeps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
name: Sapling CLI Getdeps Linux

on:
workflow_dispatch
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)
Expand Down
5 changes: 5 additions & 0 deletions build/fbcode_builder/manifests/python
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ python@3.8
python3
python3-devel

# Centos Stream 9 default python is 3.9, sapling needs 3.10+
[rpms.all(distro=centos_stream,distro_vers=9)]
python3.12
python3.12-devel

# sapling needs dataclasses which arrive in 3.7, and the bionic python is 3.6
[debs.all(distro=ubuntu,distro_vers="18.04")]
python3.8-dev
Expand Down
4 changes: 4 additions & 0 deletions build/fbcode_builder/manifests/python-setuptools
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ builder = python-wheel
[rpms]
python3-setuptools

# Centos Stream 9 default python is 3.9, sapling needs 3.10+
[rpms.all(distro=centos_stream,distro_vers=9)]
python3.12-setuptools

[homebrew]
python-setuptools

Expand Down
9 changes: 2 additions & 7 deletions eden/scm/lib/commands/debugcommands/cmddebugfilterid/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss")
load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")
Expand All @@ -20,15 +19,11 @@ rust_library(
},
}},
crate_root = "src/lib.rs",
features = [
"fb",
],
deps = [
"//eden/scm/lib/clidispatch:clidispatch",
"//eden/scm/lib/commands/cmdutil:cmdutil",
"//eden/scm/lib/repo:repo",
] + ([] if rust_oss.is_oss_build() else [
"//eden/scm/lib/filters:filters",
"//eden/scm/lib/repo:repo",
"//eden/scm/lib/types:types",
]),
],
)
35 changes: 12 additions & 23 deletions eden/scm/lib/commands/debugcommands/cmddebugfilterid/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@

#![allow(unexpected_cfgs)]

#[cfg(feature = "fb")]
use std::str::FromStr;

use clidispatch::ReqCtx;
use cmdutil::define_flags;
#[cfg(feature = "fb")]
use filters::filter::FilterGenerator;
use repo::repo::Repo;
#[cfg(feature = "fb")]
use types::HgId;
#[cfg(feature = "fb")]
use types::RepoPathBuf;

define_flags! {
Expand All @@ -34,25 +30,18 @@ define_flags! {
}

pub fn run(ctx: ReqCtx<DebugFilterIdOpts>, repo: &Repo) -> cmdutil::Result<u8> {
#[cfg(feature = "fb")]
{
let config = repo.config();
let mut filter_gen =
FilterGenerator::from_dot_dirs(repo.dot_hg_path(), repo.shared_dot_hg_path(), config)?;
let paths = ctx
.opts
.args
.into_iter()
.map(RepoPathBuf::from_string)
.collect::<Result<Vec<RepoPathBuf>, _>>()?;
let commit_id = HgId::from_str(&ctx.opts.rev)?;
let filter = filter_gen.generate_filter_id(commit_id, &paths)?;
ctx.core.io.write(filter.id()?)?
}

#[cfg(not(feature = "fb"))]
let _ = (ctx, repo);

let config = repo.config();
let mut filter_gen =
FilterGenerator::from_dot_dirs(repo.dot_hg_path(), repo.shared_dot_hg_path(), config)?;
let paths = ctx
.opts
.args
.into_iter()
.map(RepoPathBuf::from_string)
.collect::<Result<Vec<RepoPathBuf>, _>>()?;
let commit_id = HgId::from_str(&ctx.opts.rev)?;
let filter = filter_gen.generate_filter_id(commit_id, &paths)?;
ctx.core.io.write(filter.id()?)?;
Ok(0)
}

Expand Down
4 changes: 2 additions & 2 deletions eden/scm/sapling/httpclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def __init__(
if ssl_wrap_socket is not None:
_wrap_socket = ssl_wrap_socket
else:
_wrap_socket = ssl.wrap_socket
_wrap_socket = ssl.SSLContext.wrap_socket
call_wrap_socket = None
handlesubar = _handlesarg(_wrap_socket, "server_hostname")
if handlesubar is True:
Expand All @@ -470,7 +470,7 @@ def __init__(
handlesnobar = _handlesarg(_wrap_socket, "serverhostname")
if handlesnobar is True and handlesubar is not True:
# supports serverhostname
def call_wrap_socket(sock, server_hostname=None, **ssl_opts):
def call_wrap_socket(sock, server_hostname=None, **ssl_opts): # noqa: F811
return _wrap_socket(sock, serverhostname=server_hostname, **ssl_opts)

if handlesubar is False and handlesnobar is False:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ oncall("sapling")
rust_python_library(
name = "pyedenfsassertedstates",
srcs = glob(["src/**/*.rs"]),
autocargo = {
"cargo_toml_config": {
"extra_buck_dependencies": {
"dependencies": [
"fbsource//third-party/rust:anyhow",
],
},
},
},
crate_root = "src/lib.rs",
features = ["fb"],
deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "0.1.0"
edition = "2024"

[dependencies]
anyhow = "1.0.98"
cpython = { version = "0.7.2", features = ["python3-sys"], default-features = false }
edenfs-asserted-states-client = { version = "0.1.0", path = "../../../../../fs/rust/edenfs-asserted-states-client" }
sapling-configmodel = { version = "0.1.0", path = "../../../../lib/config/model" }
Expand Down
2 changes: 1 addition & 1 deletion eden/scm/tests/run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2913,7 +2913,7 @@ def progressrenderer():
timepassed = now - suitestart
lines = []
runningfrac = 0.0
for name, (test, teststart) in runningtests.items():
for name, (test, teststart) in list(runningtests.items()):
try:
saltseen, saltcount, linenum = getattr(test, "progress")
runningfrac += saltseen * 1.0 / saltcount
Expand Down
1 change: 1 addition & 0 deletions eden/scm/tests/test-git-shallow.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Test client git repo with lazy blob/tree objects.
$ . $TESTDIR/git.sh
$ git -c init.defaultBranch=main init -q server-repo
$ cd server-repo
$ git config uploadpack.allowFilter true
$ SL_IDENTITY=sl drawdag << 'EOS'
> B # bookmark main = B
> | # B/dir/1=2\n
Expand Down