jj_lib/protos/
op_store.rs

1// This file is @generated by prost-build.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct RefConflictLegacy {
5    #[deprecated]
6    #[prost(bytes = "vec", repeated, tag = "1")]
7    pub removes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
8    #[deprecated]
9    #[prost(bytes = "vec", repeated, tag = "2")]
10    pub adds: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
11}
12#[allow(clippy::derive_partial_eq_without_eq)]
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct RefConflict {
15    #[prost(message, repeated, tag = "1")]
16    pub removes: ::prost::alloc::vec::Vec<ref_conflict::Term>,
17    #[prost(message, repeated, tag = "2")]
18    pub adds: ::prost::alloc::vec::Vec<ref_conflict::Term>,
19}
20/// Nested message and enum types in `RefConflict`.
21pub mod ref_conflict {
22    #[allow(clippy::derive_partial_eq_without_eq)]
23    #[derive(Clone, PartialEq, ::prost::Message)]
24    pub struct Term {
25        #[prost(bytes = "vec", optional, tag = "1")]
26        pub value: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
27    }
28}
29#[allow(clippy::derive_partial_eq_without_eq)]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct RefTarget {
32    /// New `RefConflict` type represents both `commit_id` and `conflict_legacy`.
33    #[prost(oneof = "ref_target::Value", tags = "1, 2, 3")]
34    pub value: ::core::option::Option<ref_target::Value>,
35}
36/// Nested message and enum types in `RefTarget`.
37pub mod ref_target {
38    /// New `RefConflict` type represents both `commit_id` and `conflict_legacy`.
39    #[allow(clippy::derive_partial_eq_without_eq)]
40    #[derive(Clone, PartialEq, ::prost::Oneof)]
41    pub enum Value {
42        #[prost(bytes, tag = "1")]
43        CommitId(::prost::alloc::vec::Vec<u8>),
44        #[prost(message, tag = "2")]
45        ConflictLegacy(super::RefConflictLegacy),
46        #[prost(message, tag = "3")]
47        Conflict(super::RefConflict),
48    }
49}
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct RemoteBookmark {
53    #[prost(string, tag = "1")]
54    pub remote_name: ::prost::alloc::string::String,
55    #[prost(message, optional, tag = "2")]
56    pub target: ::core::option::Option<RefTarget>,
57    /// Introduced in jj 0.11.
58    #[prost(enumeration = "RemoteRefState", optional, tag = "3")]
59    pub state: ::core::option::Option<i32>,
60}
61#[allow(clippy::derive_partial_eq_without_eq)]
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct Bookmark {
64    #[prost(string, tag = "1")]
65    pub name: ::prost::alloc::string::String,
66    /// Unset if the bookmark has been deleted locally.
67    #[prost(message, optional, tag = "2")]
68    pub local_target: ::core::option::Option<RefTarget>,
69    /// TODO: How would we support renaming remotes while having undo work? If
70    /// the remote name is stored in config, it's going to become a mess if the
71    /// remote is renamed but the configs are left unchanged. Should each remote
72    /// be identified (here and in configs) by a UUID?
73    #[prost(message, repeated, tag = "3")]
74    pub remote_bookmarks: ::prost::alloc::vec::Vec<RemoteBookmark>,
75}
76#[allow(clippy::derive_partial_eq_without_eq)]
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct GitRef {
79    #[prost(string, tag = "1")]
80    pub name: ::prost::alloc::string::String,
81    /// This field is just for historical reasons (before we had the RefTarget
82    /// type). New GitRefs have (only) the target field.
83    /// TODO: Delete support for the old format.
84    #[prost(bytes = "vec", tag = "2")]
85    pub commit_id: ::prost::alloc::vec::Vec<u8>,
86    #[prost(message, optional, tag = "3")]
87    pub target: ::core::option::Option<RefTarget>,
88}
89#[allow(clippy::derive_partial_eq_without_eq)]
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct Tag {
92    #[prost(string, tag = "1")]
93    pub name: ::prost::alloc::string::String,
94    #[prost(message, optional, tag = "2")]
95    pub target: ::core::option::Option<RefTarget>,
96}
97#[allow(clippy::derive_partial_eq_without_eq)]
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct View {
100    #[prost(bytes = "vec", repeated, tag = "1")]
101    pub head_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
102    #[deprecated]
103    #[prost(bytes = "vec", tag = "2")]
104    pub wc_commit_id: ::prost::alloc::vec::Vec<u8>,
105    #[prost(map = "string, bytes", tag = "8")]
106    pub wc_commit_ids: ::std::collections::HashMap<
107        ::prost::alloc::string::String,
108        ::prost::alloc::vec::Vec<u8>,
109    >,
110    #[prost(message, repeated, tag = "5")]
111    pub bookmarks: ::prost::alloc::vec::Vec<Bookmark>,
112    #[prost(message, repeated, tag = "6")]
113    pub tags: ::prost::alloc::vec::Vec<Tag>,
114    /// Only a subset of the refs. For example, does not include refs/notes/.
115    #[prost(message, repeated, tag = "3")]
116    pub git_refs: ::prost::alloc::vec::Vec<GitRef>,
117    /// This field is just for historical reasons (before we had the RefTarget
118    /// type). New Views have (only) the target field.
119    /// TODO: Delete support for the old format.
120    #[deprecated]
121    #[prost(bytes = "vec", tag = "7")]
122    pub git_head_legacy: ::prost::alloc::vec::Vec<u8>,
123    #[prost(message, optional, tag = "9")]
124    pub git_head: ::core::option::Option<RefTarget>,
125}
126#[allow(clippy::derive_partial_eq_without_eq)]
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct Operation {
129    #[prost(bytes = "vec", tag = "1")]
130    pub view_id: ::prost::alloc::vec::Vec<u8>,
131    #[prost(bytes = "vec", repeated, tag = "2")]
132    pub parents: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
133    #[prost(message, optional, tag = "3")]
134    pub metadata: ::core::option::Option<OperationMetadata>,
135}
136/// TODO: Share with store.proto? Do we even need the timezone here?
137#[allow(clippy::derive_partial_eq_without_eq)]
138#[derive(Clone, PartialEq, ::prost::Message)]
139pub struct Timestamp {
140    #[prost(int64, tag = "1")]
141    pub millis_since_epoch: i64,
142    #[prost(int32, tag = "2")]
143    pub tz_offset: i32,
144}
145#[allow(clippy::derive_partial_eq_without_eq)]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct OperationMetadata {
148    #[prost(message, optional, tag = "1")]
149    pub start_time: ::core::option::Option<Timestamp>,
150    #[prost(message, optional, tag = "2")]
151    pub end_time: ::core::option::Option<Timestamp>,
152    #[prost(string, tag = "3")]
153    pub description: ::prost::alloc::string::String,
154    #[prost(string, tag = "4")]
155    pub hostname: ::prost::alloc::string::String,
156    #[prost(string, tag = "5")]
157    pub username: ::prost::alloc::string::String,
158    #[prost(bool, tag = "7")]
159    pub is_snapshot: bool,
160    #[prost(map = "string, string", tag = "6")]
161    pub tags: ::std::collections::HashMap<
162        ::prost::alloc::string::String,
163        ::prost::alloc::string::String,
164    >,
165}
166#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
167#[repr(i32)]
168pub enum RemoteRefState {
169    New = 0,
170    Tracked = 1,
171}
172impl RemoteRefState {
173    /// String value of the enum field names used in the ProtoBuf definition.
174    ///
175    /// The values are not transformed in any way and thus are considered stable
176    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
177    pub fn as_str_name(&self) -> &'static str {
178        match self {
179            RemoteRefState::New => "New",
180            RemoteRefState::Tracked => "Tracked",
181        }
182    }
183    /// Creates an enum from field names used in the ProtoBuf definition.
184    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
185        match value {
186            "New" => Some(Self::New),
187            "Tracked" => Some(Self::Tracked),
188            _ => None,
189        }
190    }
191}