mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
fix tests which were broken by changing in the order of parsing bundle2
Summary: Resolving pushvars before commonheads breaks hooks tests (they were disabled, so didn't come up) The order was changed in D13802402, So, this diff changes the order as it was before and keep the remaining logic. Reviewed By: StanislavGlebik Differential Revision: D13817434 fbshipit-source-id: 1443b18ade7161304f8b5359e7d49dab13b022cc
This commit is contained in:
parent
5ff6db64ef
commit
c7d0239bbc
@ -71,22 +71,32 @@ pub fn resolve(
|
||||
let bundle2 = resolver.resolve_start_and_replycaps(bundle2);
|
||||
|
||||
resolver
|
||||
.maybe_resolve_pushvars(bundle2)
|
||||
.and_then(move |(maybe_pushvars, bundle2)| {
|
||||
let mut bypass_readonly = false;
|
||||
// check the bypass condition
|
||||
if let Some(ref pushvars) = maybe_pushvars {
|
||||
bypass_readonly =
|
||||
pushvars.get("BYPASS_READONLY").map(|s| s.to_ascii_lowercase()) == Some("true".into())
|
||||
.maybe_resolve_commonheads(bundle2)
|
||||
.and_then({
|
||||
cloned!(resolver);
|
||||
move |(commonheads, bundle2)| {
|
||||
resolver.maybe_resolve_pushvars(bundle2).and_then(
|
||||
move |(maybe_pushvars, bundle2)| {
|
||||
let mut bypass_readonly = false;
|
||||
// check the bypass condition
|
||||
if let Some(ref pushvars) = maybe_pushvars {
|
||||
bypass_readonly = pushvars
|
||||
.get("BYPASS_READONLY")
|
||||
.map(|s| s.to_ascii_lowercase())
|
||||
== Some("true".into());
|
||||
}
|
||||
// force the readonly check
|
||||
if readonly == RepoReadOnly::ReadOnly && !bypass_readonly {
|
||||
future::err(ErrorKind::RepoReadOnly.into()).left_future()
|
||||
} else {
|
||||
future::ok((maybe_pushvars, commonheads, bundle2)).right_future()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
// force the readonly check
|
||||
if readonly == RepoReadOnly::ReadOnly && !bypass_readonly {
|
||||
return future::err(ErrorKind::RepoReadOnly.into()).left_future();
|
||||
}
|
||||
resolver
|
||||
.maybe_resolve_commonheads(bundle2)
|
||||
.and_then(move |(commonheads, bundle2)| {
|
||||
if let Some(commonheads) = commonheads {
|
||||
})
|
||||
.and_then(move |(maybe_pushvars, commonheads, bundle2)| {
|
||||
if let Some(commonheads) = commonheads {
|
||||
resolve_pushrebase(
|
||||
ctx,
|
||||
commonheads,
|
||||
@ -99,8 +109,6 @@ pub fn resolve(
|
||||
} else {
|
||||
resolve_push(ctx, resolver, bundle2)
|
||||
}
|
||||
})
|
||||
.right_future()
|
||||
})
|
||||
.boxify()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user