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 RemoteRef {
94    #[prost(string, tag = "1")]
95    pub name: ::prost::alloc::string::String,
96    #[prost(message, repeated, tag = "2")]
97    pub target_terms: ::prost::alloc::vec::Vec<RefTargetTerm>,
98    #[prost(enumeration = "RemoteRefState", tag = "3")]
99    pub state: i32,
100}
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct Tag {
103    #[prost(string, tag = "1")]
104    pub name: ::prost::alloc::string::String,
105    #[prost(message, optional, tag = "2")]
106    pub target: ::core::option::Option<RefTarget>,
107}
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct View {
110    #[prost(bytes = "vec", repeated, tag = "1")]
111    pub head_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
112    #[deprecated]
113    #[prost(bytes = "vec", tag = "2")]
114    pub wc_commit_id: ::prost::alloc::vec::Vec<u8>,
115    #[prost(map = "string, bytes", tag = "8")]
116    pub wc_commit_ids: ::std::collections::HashMap<
117        ::prost::alloc::string::String,
118        ::prost::alloc::vec::Vec<u8>,
119    >,
120    /// Local bookmarks and remote bookmarks in legacy form.
121    #[prost(message, repeated, tag = "5")]
122    pub bookmarks: ::prost::alloc::vec::Vec<Bookmark>,
123    #[prost(message, repeated, tag = "6")]
124    pub local_tags: ::prost::alloc::vec::Vec<Tag>,
125    /// Introduced in jj 0.34.
126    #[prost(message, repeated, tag = "11")]
127    pub remote_views: ::prost::alloc::vec::Vec<RemoteView>,
128    /// Only a subset of the refs. For example, does not include refs/notes/.
129    #[prost(message, repeated, tag = "3")]
130    pub git_refs: ::prost::alloc::vec::Vec<GitRef>,
131    /// This field is just for historical reasons (before we had the RefTarget
132    /// type). New Views have (only) the target field.
133    /// TODO: Delete support for the old format.
134    #[deprecated]
135    #[prost(bytes = "vec", tag = "7")]
136    pub git_head_legacy: ::prost::alloc::vec::Vec<u8>,
137    #[prost(message, optional, tag = "9")]
138    pub git_head: ::core::option::Option<RefTarget>,
139    /// Whether "@git" tags have been migrated to remote_views.
140    #[prost(bool, tag = "12")]
141    pub has_git_refs_migrated_to_remote_tags: bool,
142}
143#[derive(Clone, PartialEq, ::prost::Message)]
144pub struct RemoteView {
145    #[prost(string, tag = "1")]
146    pub name: ::prost::alloc::string::String,
147    #[prost(message, repeated, tag = "2")]
148    pub bookmarks: ::prost::alloc::vec::Vec<RemoteRef>,
149    #[prost(message, repeated, tag = "3")]
150    pub tags: ::prost::alloc::vec::Vec<RemoteRef>,
151}
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct Operation {
154    #[prost(bytes = "vec", tag = "1")]
155    pub view_id: ::prost::alloc::vec::Vec<u8>,
156    #[prost(bytes = "vec", repeated, tag = "2")]
157    pub parents: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
158    #[prost(message, optional, tag = "3")]
159    pub metadata: ::core::option::Option<OperationMetadata>,
160    /// Introduced in jj 0.30.
161    #[prost(message, repeated, tag = "4")]
162    pub commit_predecessors: ::prost::alloc::vec::Vec<CommitPredecessors>,
163    /// Whether or not `commit_predecessors` is recorded.
164    #[prost(bool, tag = "5")]
165    pub stores_commit_predecessors: bool,
166}
167/// TODO: Share with store.proto? Do we even need the timezone here?
168#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
169pub struct Timestamp {
170    #[prost(int64, tag = "1")]
171    pub millis_since_epoch: i64,
172    #[prost(int32, tag = "2")]
173    pub tz_offset: i32,
174}
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct OperationMetadata {
177    #[prost(message, optional, tag = "1")]
178    pub start_time: ::core::option::Option<Timestamp>,
179    #[prost(message, optional, tag = "2")]
180    pub end_time: ::core::option::Option<Timestamp>,
181    #[prost(string, tag = "3")]
182    pub description: ::prost::alloc::string::String,
183    #[prost(string, tag = "4")]
184    pub hostname: ::prost::alloc::string::String,
185    #[prost(string, tag = "5")]
186    pub username: ::prost::alloc::string::String,
187    #[prost(bool, tag = "7")]
188    pub is_snapshot: bool,
189    #[prost(map = "string, string", tag = "6")]
190    pub tags: ::std::collections::HashMap<
191        ::prost::alloc::string::String,
192        ::prost::alloc::string::String,
193    >,
194}
195#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
196pub struct CommitPredecessors {
197    #[prost(bytes = "vec", tag = "1")]
198    pub commit_id: ::prost::alloc::vec::Vec<u8>,
199    #[prost(bytes = "vec", repeated, tag = "2")]
200    pub predecessor_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
201}
202#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
203#[repr(i32)]
204pub enum RemoteRefState {
205    New = 0,
206    Tracked = 1,
207}
208impl RemoteRefState {
209    /// String value of the enum field names used in the ProtoBuf definition.
210    ///
211    /// The values are not transformed in any way and thus are considered stable
212    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
213    pub fn as_str_name(&self) -> &'static str {
214        match self {
215            Self::New => "New",
216            Self::Tracked => "Tracked",
217        }
218    }
219    /// Creates an enum from field names used in the ProtoBuf definition.
220    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
221        match value {
222            "New" => Some(Self::New),
223            "Tracked" => Some(Self::Tracked),
224            _ => None,
225        }
226    }
227}