ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/lib/src
Evan Mesterhazy 2b0aa84c9d CommitRewriter::rewrite_parents(): Take IntoIterator instead of &[CommitId]
CommitIds are often manipulated by reference, so this makes the API more
flexible for cases where the caller doesn't already have a Vec or array of
owned CommitIds.

In many cases `rewrite_parents()` does not even need to clone the input
CommitIds.  This refactor allows the clone to be avoided if it's unnecessary.

There might be other APIs that would benefit from a similar change. In general,
it seems like there are a lot of places where we're writing
`&[commit_x.id().clone, commit_y.id().clone()]` and similiar.

- [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/flexibility.html#functions-minimize-assumptions-about-parameters-by-using-generics-c-generic)
2024-04-21 23:31:17 -04:00
..
default_index revset: migrate file() predicate to be based on FilesetExpression 2024-04-06 23:59:54 +09:00
lock perf: add several #[instrument]s 2023-07-28 09:28:01 -07:00
protos protos: cargo update prost prost-builder and regenerate protobufs 2024-04-05 16:56:20 -07:00
backend.rs git_backend: classify "merge with root" as user error 2024-03-30 11:14:25 +09:00
commit.rs commit: actually remove boxing from CommitIteratorExt::ids() 2024-04-05 00:16:42 +09:00
commit_builder.rs clippy: disable bogus lints for nightly clippy 2024-04-05 11:39:29 -05:00
conflicts.rs cli: pass MaterializedTreeValue into git_diff_part() 2023-11-10 04:54:47 -08:00
content_hash.rs Nightly clippy fixes 2024-03-02 18:19:14 -08:00
dag_walk.rs dag_walk: add fallible topo_order_reverse_lazy() 2023-11-14 07:16:39 +09:00
default_submodule_store.rs backends: deduplicate definition of backend names 2023-10-14 06:38:35 -07:00
diff.rs refactor(jj-lib): remove nightly_shims gunk 2023-07-17 18:38:26 -05:00
dsl_util.rs dsl_util: deduplicate collect_similar() from revset and templater 2024-04-09 20:42:09 +09:00
extensions_map.rs extensions_map: create a type-safe container for arbitrary objects 2024-03-12 16:52:49 -04:00
file_util.rs working_copy: implement symlinks on windows with a helper function 2024-03-05 15:16:38 +08:00
files.rs clippy: remove some unused code beta clippy/rustc compain about 2024-03-19 18:33:29 -07:00
fileset.pest fileset: relax identifier rule to accept more path-like strings 2024-04-09 20:42:09 +09:00
fileset.rs fileset: parse cwd/root-glob patterns 2024-04-18 11:09:54 +09:00
fileset_parser.rs fileset: relax identifier rule to accept more path-like strings 2024-04-09 20:42:09 +09:00
fmt_util.rs settings: support human-readable byte sizes for max-new-file-size 2023-08-17 19:29:38 -07:00
fsmonitor.rs New jj debug watchman status command 2024-04-11 10:55:59 -07:00
git.rs lib git.rs: minor simplification, fixup to 62b14e1f 2024-04-17 19:51:57 -07:00
git_backend.rs git_backend: classify "merge with root" as user error 2024-03-30 11:14:25 +09:00
gitignore.rs gitignore: make objects chain be more Arc friendly 2024-02-24 15:55:10 +09:00
gpg_signing.rs signing: insert tracing events to command invocation paths 2024-03-05 09:23:15 +09:00
hex_util.rs hex_utils: fix typo found by clippy 2024-03-25 21:23:09 -07:00
id_prefix.rs Nightly clippy fixes 2024-03-02 18:19:14 -08:00
index.rs index: remove topo_order() which is no longer used 2024-03-17 11:44:41 +09:00
lib.rs fileset: add grammar and implement parser (without name resolution) 2024-04-09 20:42:09 +09:00
local_backend.rs clippy: disable bogus lints for nightly clippy 2024-04-05 11:39:29 -05:00
local_working_copy.rs working_copy: allow load_working_copy() to return error 2024-04-19 15:22:37 -07:00
lock.rs lock: remove byteorder dependency from tests, use fs helper functions 2023-12-23 00:14:17 +09:00
matchers.rs matchers: add matcher for glob patterns 2024-04-18 11:09:54 +09:00
merge.rs politics: delete references to Pijul 2024-04-14 13:16:08 -07:00
merged_tree.rs tree: flatten TreeMergeError into BackendError 2024-03-30 22:40:05 +09:00
object_id.rs Add documentation comments for several types 2024-03-02 15:01:55 -05:00
op_heads_store.rs backend: allow cheap copy of MillisSinceEpoch(i64) 2024-02-25 09:00:56 +09:00
op_store.rs Replace uses of content_hash! with #[derive(ContentHash)] 2024-02-20 14:18:13 -05:00
op_walk.rs operation: add shorthand for .store_operation().metadata 2024-02-25 09:00:56 +09:00
operation.rs Add documentation comments for operation, transaction, and view types 2024-03-02 15:35:41 -05:00
refs.rs lib refs.rs: rename TrackingRefPair to LocalAndRemoteRef 2024-02-07 17:06:28 -08:00
repo.rs repo: take owned commit IDs to MutableRepo::new_parents() 2024-04-18 21:06:52 -07:00
repo_path.rs cli: suggest root:"<path>" if cwd-relative path is not in workspace 2024-04-19 09:35:47 +09:00
revset.pest revset: rewrite identifier rule in common infix-op rule pattern 2024-04-08 00:37:25 +09:00
revset.rs dsl_util: deduplicate collect_similar() from revset and templater 2024-04-09 20:42:09 +09:00
revset_graph.rs clippy: Fix nightly warnings about "useless use of vec!" 2024-01-25 22:00:26 -08:00
rewrite.rs CommitRewriter::rewrite_parents(): Take IntoIterator instead of &[CommitId] 2024-04-21 23:31:17 -04:00
settings.rs cli: allow snapshot.max-new-file-size to be a raw u64 2024-04-19 13:03:24 -05:00
signing.rs sign: Implement SSH signing backend 2024-02-20 00:02:08 +00:00
simple_op_heads_store.rs backends: implement as_any() on OpStore and OpHeadsStore too 2024-01-31 00:15:29 -08:00
simple_op_store.rs Nightly clippy fixes 2024-03-02 18:19:14 -08:00
ssh_signing.rs signing: insert tracing events to command invocation paths 2024-03-05 09:23:15 +09:00
stacked_table.rs clippy: disable bogus lints for nightly clippy 2024-04-05 11:39:29 -05:00
store.rs backend: pass Index and keep_newer timestamp parameters to gc() 2024-01-27 10:18:11 +09:00
str_util.rs cli: render string pattern suggestion as a hint 2024-03-30 23:53:17 +09:00
submodule_store.rs docs: warn about missing docs for jj-lib crate 2023-07-10 18:28:59 +03:00
transaction.rs Store OpHeadsStore in UnpublishedOperation instead of RepoLoader 2024-03-02 23:08:57 -05:00
tree.rs tree: flatten TreeMergeError into BackendError 2024-03-30 22:40:05 +09:00
tree_builder.rs rust: bump MSRV to 1.76.0 2024-02-09 15:48:01 -06:00
view.rs Implement advance-branches for jj commit 2024-04-20 10:26:04 -04:00
working_copy.rs working_copy: allow load_working_copy() to return error 2024-04-19 15:22:37 -07:00
workspace.rs working_copy: allow load_working_copy() to return error 2024-04-19 15:22:37 -07:00