Skip to content

Commit

Permalink
cli: add short method summary to its documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Oct 4, 2024
1 parent 8ba33b7 commit fb12e48
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
19 changes: 11 additions & 8 deletions cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,15 @@ impl ReadonlyUserRepo {
}
}

/// A bookmark that should be advanced to satisfy the "advance-bookmarks"
/// feature. This is a helper for `WorkspaceCommandTransaction`. It provides a
/// type-safe way to separate the work of checking whether a bookmark can be
/// advanced and actually advancing it. Advancing the bookmark never fails, but
/// can't be done until the new `CommitId` is available. Splitting the work in
/// this way also allows us to identify eligible bookmarks without actually
/// moving them and return config errors to the user early.
/// A advanceable bookmark to satisfy the "advance-bookmarks" feature.
///
/// This is a helper for `WorkspaceCommandTransaction`. It provides a
/// type-safe way to separate the work of checking whether a bookmark
/// can be advanced and actually advancing it. Advancing the bookmark
/// never fails, but can't be done until the new `CommitId` is
/// available. Splitting the work in this way also allows us to
/// identify eligible bookmarks without actually moving them and
/// return config errors to the user early.
pub struct AdvanceableBookmark {
name: String,
old_commit_id: CommitId,
Expand Down Expand Up @@ -1999,7 +2001,8 @@ Then run `jj squash` to move the resolution into the conflicted commit."#,
}
}

/// A [`Transaction`] tied to a particular workspace.
/// An ongoing [`Transaction`] tied to a particular workspace.
///
/// `WorkspaceCommandTransaction`s are created with
/// [`WorkspaceCommandHelper::start_transaction`] and committed with
/// [`WorkspaceCommandTransaction::finish`]. The inner `Transaction` can also be
Expand Down
9 changes: 5 additions & 4 deletions cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,11 @@ pub fn existing_config_path() -> Result<Option<PathBuf>, ConfigError> {
ConfigEnv::new().existing_config_path()
}

/// Returns a path to the user-specific config file. If no config file is found,
/// tries to guess a reasonable new location for it. If a path to a new config
/// file is returned, the parent directory may be created as a result of this
/// call.
/// Returns a path to the user-specific config file.
///
/// If no config file is found, tries to guess a reasonable new
/// location for it. If a path to a new config file is returned, the
/// parent directory may be created as a result of this call.
pub fn new_config_path() -> Result<Option<PathBuf>, ConfigError> {
ConfigEnv::new().new_config_path()
}
Expand Down

0 comments on commit fb12e48

Please sign in to comment.