Skip to main content

jj_lib/protos/
simple_op_store.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct RefConflictLegacy {
4    #[deprecated]
5    #[prost(bytes = "vec", repeated, tag = "1")]
6    pub removes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
7    #[deprecated]
8    #[prost(bytes = "vec", repeated, tag = "2")]
9    pub adds: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
10}
11/// This is redundant with `RefTargetTerm`. It exists for historical reasons.
12/// TODO: Consider deprecating it.
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    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
23    pub struct Term {
24        #[prost(bytes = "vec", optional, tag = "1")]
25        pub value: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
26    }
27}
28/// RefTarget that may be serialized in legacy form.
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct RefTarget {
31    /// New `RefConflict` type represents both `commit_id` and `conflict_legacy`.
32    #[prost(oneof = "ref_target::Value", tags = "1, 2, 3")]
33    pub value: ::core::option::Option<ref_target::Value>,
34}
35/// Nested message and enum types in `RefTarget`.
36pub mod ref_target {
37    /// New `RefConflict` type represents both `commit_id` and `conflict_legacy`.
38    #[derive(Clone, PartialEq, ::prost::Oneof)]
39    pub enum Value {
40        #[deprecated]
41        #[prost(bytes, tag = "1")]
42        CommitId(::prost::alloc::vec::Vec<u8>),
43        #[deprecated]
44        #[prost(message, tag = "2")]
45        ConflictLegacy(super::RefConflictLegacy),
46        #[prost(message, tag = "3")]
47        Conflict(super::RefConflict),
48    }
49}
50/// RefTarget term that should be serialized in native form, in which positive
51/// and negative terms alternate.
52#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
53pub struct RefTargetTerm {
54    #[prost(bytes = "vec", optional, tag = "1")]
55    pub value: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
56}
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct RemoteBookmark {
59    #[prost(string, tag = "1")]
60    pub remote_name: ::prost::alloc::string::String,
61    #[prost(message, optional, tag = "2")]
62    pub target: ::core::option::Option<RefTarget>,
63    /// Introduced in jj 0.11.
64    #[prost(enumeration = "RemoteRefState", optional, tag = "3")]
65    pub state: ::core::option::Option<i32>,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct Bookmark {
69    #[prost(string, tag = "1")]
70    pub name: ::prost::alloc::string::String,
71    /// Unset if the bookmark has been deleted locally.
72    #[prost(message, optional, tag = "2")]
73    pub local_target: ::core::option::Option<RefTarget>,
74    /// Deprecated since jj 0.34.
75    #[deprecated]
76    #[prost(message, repeated, tag = "3")]
77    pub remote_bookmarks: ::prost::alloc::vec::Vec<RemoteBookmark>,
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct GitRef {
81    #[prost(string, tag = "1")]
82    pub name: ::prost::alloc::string::String,
83    /// This field is just for historical reasons (before we had the RefTarget
84    /// type). New GitRefs have (only) the target field.
85    /// TODO: Delete support for the old format.
86    #[deprecated]
87    #[prost(bytes = "vec", tag = "2")]
88    pub commit_id: ::prost::alloc::vec::Vec<u8>,
89    #[prost(message, optional, tag = "3")]
90    pub target: ::core::option::Option<RefTarget>,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct GitHead {
94    #[prost(string, tag = "1")]
95    pub name: ::prost::alloc::string::String,
96    #[prost(message, optional, tag = "2")]
97    pub target: ::core::option::Option<RefTarget>,
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct RemoteRef {
101    #[prost(string, tag = "1")]
102    pub name: ::prost::alloc::string::String,
103    #[prost(message, repeated, tag = "2")]
104    pub target_terms: ::prost::alloc::vec::Vec<RefTargetTerm>,
105    #[prost(enumeration = "RemoteRefState", tag = "3")]
106    pub state: i32,
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct Tag {
110    #[prost(string, tag = "1")]
111    pub name: ::prost::alloc::string::String,
112    #[prost(message, optional, tag = "2")]
113    pub target: ::core::option::Option<RefTarget>,
114}
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct View {
117    #[prost(bytes = "vec", repeated, tag = "1")]
118    pub head_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
119    #[deprecated]
120    #[prost(bytes = "vec", tag = "2")]
121    pub wc_commit_id: ::prost::alloc::vec::Vec<u8>,
122    #[prost(map = "string, bytes", tag = "8")]
123    pub wc_commit_ids: ::std::collections::HashMap<
124        ::prost::alloc::string::String,
125        ::prost::alloc::vec::Vec<u8>,
126    >,
127    /// Local bookmarks and remote bookmarks in legacy form.
128    #[prost(message, repeated, tag = "5")]
129    pub bookmarks: ::prost::alloc::vec::Vec<Bookmark>,
130    #[prost(message, repeated, tag = "6")]
131    pub local_tags: ::prost::alloc::vec::Vec<Tag>,
132    /// Introduced in jj 0.34.
133    #[prost(message, repeated, tag = "11")]
134    pub remote_views: ::prost::alloc::vec::Vec<RemoteView>,
135    /// Only a subset of the refs. For example, does not include refs/notes/.
136    #[prost(message, repeated, tag = "3")]
137    pub git_refs: ::prost::alloc::vec::Vec<GitRef>,
138    /// This field is just for historical reasons (before we had the RefTarget
139    /// type). New Views have (only) the target field.
140    /// TODO: Delete support for the old format.
141    #[deprecated]
142    #[prost(bytes = "vec", tag = "7")]
143    pub git_head_legacy: ::prost::alloc::vec::Vec<u8>,
144    #[deprecated]
145    #[prost(message, optional, tag = "9")]
146    pub git_head: ::core::option::Option<RefTarget>,
147    /// Whether "@git" tags have been migrated to remote_views.
148    #[prost(bool, tag = "12")]
149    pub has_git_refs_migrated_to_remote_tags: bool,
150    /// Per-workspace Git HEAD targets, keyed by workspace name.
151    #[prost(message, repeated, tag = "13")]
152    pub git_heads: ::prost::alloc::vec::Vec<GitHead>,
153}
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct RemoteView {
156    #[prost(string, tag = "1")]
157    pub name: ::prost::alloc::string::String,
158    #[prost(message, repeated, tag = "2")]
159    pub bookmarks: ::prost::alloc::vec::Vec<RemoteRef>,
160    #[prost(message, repeated, tag = "3")]
161    pub tags: ::prost::alloc::vec::Vec<RemoteRef>,
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct Operation {
165    #[prost(bytes = "vec", tag = "1")]
166    pub view_id: ::prost::alloc::vec::Vec<u8>,
167    #[prost(bytes = "vec", repeated, tag = "2")]
168    pub parents: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
169    #[prost(message, optional, tag = "3")]
170    pub metadata: ::core::option::Option<OperationMetadata>,
171    /// Introduced in jj 0.30.
172    #[prost(message, repeated, tag = "4")]
173    pub commit_predecessors: ::prost::alloc::vec::Vec<CommitPredecessors>,
174    /// Whether or not `commit_predecessors` is recorded.
175    #[prost(bool, tag = "5")]
176    pub stores_commit_predecessors: bool,
177}
178/// TODO: Share with store.proto? Do we even need the timezone here?
179#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
180pub struct Timestamp {
181    #[prost(int64, tag = "1")]
182    pub millis_since_epoch: i64,
183    #[prost(int32, tag = "2")]
184    pub tz_offset: i32,
185}
186#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct OperationMetadata {
188    #[prost(message, optional, tag = "1")]
189    pub start_time: ::core::option::Option<Timestamp>,
190    #[prost(message, optional, tag = "2")]
191    pub end_time: ::core::option::Option<Timestamp>,
192    #[prost(string, tag = "3")]
193    pub description: ::prost::alloc::string::String,
194    #[prost(string, tag = "4")]
195    pub hostname: ::prost::alloc::string::String,
196    #[prost(string, tag = "5")]
197    pub username: ::prost::alloc::string::String,
198    #[prost(bool, tag = "7")]
199    pub is_snapshot: bool,
200    #[prost(string, optional, tag = "8")]
201    pub workspace_name: ::core::option::Option<::prost::alloc::string::String>,
202    #[prost(map = "string, string", tag = "6")]
203    pub attributes: ::std::collections::HashMap<
204        ::prost::alloc::string::String,
205        ::prost::alloc::string::String,
206    >,
207}
208#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
209pub struct CommitPredecessors {
210    #[prost(bytes = "vec", tag = "1")]
211    pub commit_id: ::prost::alloc::vec::Vec<u8>,
212    #[prost(bytes = "vec", repeated, tag = "2")]
213    pub predecessor_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
214}
215#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
216#[repr(i32)]
217pub enum RemoteRefState {
218    New = 0,
219    Tracked = 1,
220}
221impl RemoteRefState {
222    /// String value of the enum field names used in the ProtoBuf definition.
223    ///
224    /// The values are not transformed in any way and thus are considered stable
225    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
226    pub fn as_str_name(&self) -> &'static str {
227        match self {
228            Self::New => "New",
229            Self::Tracked => "Tracked",
230        }
231    }
232    /// Creates an enum from field names used in the ProtoBuf definition.
233    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
234        match value {
235            "New" => Some(Self::New),
236            "Tracked" => Some(Self::Tracked),
237            _ => None,
238        }
239    }
240}