Add bubble id to FetchSnapshotResponse and store it on client for snapshot update

Summary: Added bubble id to FetchSnapshotResponse. Also updated hg client to store latest bubble information when updating snapshot.

Reviewed By: yancouto

Differential Revision: D34042287

fbshipit-source-id: 3c206caba4fa7b833cf1f8e23123b5b6006e2890
This commit is contained in:
Jae Jang 2022-02-08 08:27:30 -08:00 committed by Facebook GitHub Bot
parent 799801cf79
commit 63ba8c7d8d
4 changed files with 6 additions and 3 deletions

View File

@ -443,6 +443,7 @@ impl EdenApiHandler for FetchSnapshotHandler {
))
})
.collect::<Result<_, Error>>()?,
bubble_id: Some(bubble_id.into()),
};
Ok(stream::once(async move { Ok(response) }).boxed())
}

View File

@ -144,5 +144,4 @@ def update(ui, repo, csid, clean=False):
if wctx[path].isexec():
wctx[path].setflags(l=False, x=False)
# TODO(yancouto): Also update bubble here, need to get it from server
storelatest(repo.metalog(), csid, None)
storelatest(repo.metalog(), csid, snapshot["bubble_id"])

View File

@ -519,6 +519,8 @@ pub struct FetchSnapshotResponse {
pub time: i64,
#[id(5)]
pub tz: i32,
#[id(6)]
pub bubble_id: Option<NonZeroU64>,
}
#[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
@ -604,6 +606,7 @@ impl Arbitrary for FetchSnapshotResponse {
tz: Arbitrary::arbitrary(g),
hg_parents: Arbitrary::arbitrary(g),
file_changes: Arbitrary::arbitrary(g),
bubble_id: Arbitrary::arbitrary(g),
}
}
}

View File

@ -3,4 +3,4 @@ source: commit.rs
expression: "WireFetchSnapshotResponse::arbitrary(&mut g)"
---
{"2":[["eunu/tbfkhej/l/av/rc",{"1":[{"1":{"1":{"5":[4,46,38,85,25,36,58,55,101,239,1,100,81,21,29,1,4,212,7,211,178,104,186,230,81,160,133,254,52,10,95,232]}},"2":{"1":[130,59,15]}},"1"]}]],"3":"€","4":2786141136387072907,"5":1972664653}
{"2":[["eunu/tbfkhej/l/av/rc",{"1":[{"1":{"1":{"5":[4,46,38,85,25,36,58,55,101,239,1,100,81,21,29,1,4,212,7,211,178,104,186,230,81,160,133,254,52,10,95,232]}},"2":{"1":[130,59,15]}},"1"]}]],"3":"€","4":2786141136387072907,"5":1972664653,"6":170816030284369967}