Skip to content

Commit

Permalink
Add more TODOs and comments
Browse files Browse the repository at this point in the history
Summary:
## This stack
This stack will perform many refactors and bring improvements to the cross-repo codebase.

## This diff
Adding more TODO comments and moving some methods inside a file to keep them grouped.

Reviewed By: lmvasquezg

Differential Revision: D68768700

fbshipit-source-id: af550572d9c747ce64c2f828a72851c012fa46b1
  • Loading branch information
gustavoavena authored and facebook-github-bot committed Jan 31, 2025
1 parent b87133d commit 8ccaf24
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 26 deletions.
2 changes: 2 additions & 0 deletions eden/mononoke/cmdlib/x_repo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub trait Repo = cross_repo_sync::Repo
+ for<'b> facet::AsyncBuildable<'b, repo_factory::RepoFactoryBuilder<'b>>;

/// Instantiate the `Syncers` struct by parsing `matches`
/// TODO(T213755338): delete this and use `create_commit_syncers_from_app` in
/// cmdlib/cross_repo.
pub async fn create_commit_syncers_from_matches<R: Repo>(
ctx: &CoreContext,
matches: &MononokeMatches<'_>,
Expand Down
2 changes: 2 additions & 0 deletions eden/mononoke/commit_rewriting/backsyncer/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ async fn compare_contents(
source_hg_cs_id: HgChangesetId,
target_hg_cs_id: HgChangesetId,
commit_syncer: CommitSyncer<TestRepo>,
// TODO(T182311609): stop taking Movers and call a commit syncer method to
// move paths.
movers: Movers,
) -> Result<(), Error> {
let source_content =
Expand Down
58 changes: 32 additions & 26 deletions eden/mononoke/commit_rewriting/cross_repo_sync/src/commit_syncer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,32 +376,7 @@ where
&self.live_commit_sync_config
}

pub async fn get_movers_by_version(
&self,
version: &CommitSyncConfigVersion,
) -> Result<Movers, Error> {
get_movers_by_version(
version,
Arc::clone(&self.live_commit_sync_config),
Source(self.repos.get_source_repo().repo_identity().id()),
Target(self.repos.get_target_repo().repo_identity().id()),
)
.boxed()
.await
}

pub async fn get_bookmark_renamer(&self) -> Result<BookmarkRenamer, Error> {
let (source_repo, target_repo) = self.get_source_target();

get_bookmark_renamer(
Arc::clone(&self.live_commit_sync_config),
source_repo.repo_identity().id(),
target_repo.repo_identity().id(),
)
.boxed()
.await
}

// TODO(T182311609): unify commit sync outcome methods
pub async fn get_plural_commit_sync_outcome<'a>(
&'a self,
ctx: &'a CoreContext,
Expand Down Expand Up @@ -458,6 +433,7 @@ where
.await
}

// TODO(T182311609): should this be public?
pub async fn get_common_pushrebase_bookmarks(&self) -> Result<Vec<BookmarkKey>, Error> {
get_common_pushrebase_bookmarks(
Arc::clone(&self.live_commit_sync_config),
Expand All @@ -467,6 +443,22 @@ where
.await
}

// TODO(T182311609): delete this. It shouldn't be used by CommitSyncer clients.
pub async fn get_movers_by_version(
&self,
version: &CommitSyncConfigVersion,
) -> Result<Movers, Error> {
get_movers_by_version(
version,
Arc::clone(&self.live_commit_sync_config),
Source(self.repos.get_source_repo().repo_identity().id()),
Target(self.repos.get_target_repo().repo_identity().id()),
)
.boxed()
.await
}

// TODO(T182311609): delete this. It shouldn't be used by CommitSyncer clients.
pub async fn get_reverse_mover_by_version(
&self,
version: &CommitSyncConfigVersion,
Expand All @@ -482,6 +474,20 @@ where
.await
}

// TODO(T182311609): delete this. It shouldn't be used by CommitSyncer clients.
pub async fn get_bookmark_renamer(&self) -> Result<BookmarkRenamer, Error> {
let (source_repo, target_repo) = self.get_source_target();

get_bookmark_renamer(
Arc::clone(&self.live_commit_sync_config),
source_repo.repo_identity().id(),
target_repo.repo_identity().id(),
)
.boxed()
.await
}

// TODO(T182311609): delete this. It shouldn't be used by CommitSyncer clients.
pub(crate) async fn get_reverse_bookmark_renamer(&self) -> Result<BookmarkRenamer, Error> {
let (source_repo, target_repo) = self.get_source_target();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,10 @@ pub struct Syncers<R: Repo> {
pub small_to_large: CommitSyncer<R>,
}

// TODO(T182311609): Remove circular dependency between commit_syncers_lib
// and commit_syncer.

// TODO(T182311609): move this out of commit_syncers_lib module.
pub fn create_commit_syncers<R>(
ctx: &CoreContext,
small_repo: R,
Expand Down

0 comments on commit 8ccaf24

Please sign in to comment.