jj_lib/protos/
working_copy.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 MaterializedConflictData {
5    /// TODO: maybe we should store num_sides here as well
6    #[prost(uint32, tag = "1")]
7    pub conflict_marker_len: u32,
8}
9#[allow(clippy::derive_partial_eq_without_eq)]
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct FileState {
12    #[prost(int64, tag = "1")]
13    pub mtime_millis_since_epoch: i64,
14    #[prost(uint64, tag = "2")]
15    pub size: u64,
16    #[prost(enumeration = "FileType", tag = "3")]
17    pub file_type: i32,
18    /// Set only if file_type is Conflict
19    #[deprecated]
20    #[prost(bytes = "vec", tag = "4")]
21    pub conflict_id: ::prost::alloc::vec::Vec<u8>,
22    #[prost(message, optional, tag = "5")]
23    pub materialized_conflict_data: ::core::option::Option<MaterializedConflictData>,
24}
25#[allow(clippy::derive_partial_eq_without_eq)]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct FileStateEntry {
28    #[prost(string, tag = "1")]
29    pub path: ::prost::alloc::string::String,
30    #[prost(message, optional, tag = "2")]
31    pub state: ::core::option::Option<FileState>,
32}
33#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct SparsePatterns {
36    #[prost(string, repeated, tag = "1")]
37    pub prefixes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
38}
39#[allow(clippy::derive_partial_eq_without_eq)]
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct TreeState {
42    #[prost(bytes = "vec", tag = "1")]
43    pub legacy_tree_id: ::prost::alloc::vec::Vec<u8>,
44    /// Alternating positive and negative terms if there's a conflict, otherwise a
45    /// single (positive) value
46    #[prost(bytes = "vec", repeated, tag = "5")]
47    pub tree_ids: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
48    #[prost(message, repeated, tag = "2")]
49    pub file_states: ::prost::alloc::vec::Vec<FileStateEntry>,
50    #[prost(bool, tag = "6")]
51    pub is_file_states_sorted: bool,
52    #[prost(message, optional, tag = "3")]
53    pub sparse_patterns: ::core::option::Option<SparsePatterns>,
54    #[prost(message, optional, tag = "4")]
55    pub watchman_clock: ::core::option::Option<WatchmanClock>,
56}
57#[allow(clippy::derive_partial_eq_without_eq)]
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct WatchmanClock {
60    #[prost(oneof = "watchman_clock::WatchmanClock", tags = "1, 2")]
61    pub watchman_clock: ::core::option::Option<watchman_clock::WatchmanClock>,
62}
63/// Nested message and enum types in `WatchmanClock`.
64pub mod watchman_clock {
65    #[allow(clippy::derive_partial_eq_without_eq)]
66    #[derive(Clone, PartialEq, ::prost::Oneof)]
67    pub enum WatchmanClock {
68        #[prost(string, tag = "1")]
69        StringClock(::prost::alloc::string::String),
70        #[prost(int64, tag = "2")]
71        UnixTimestamp(i64),
72    }
73}
74#[allow(clippy::derive_partial_eq_without_eq)]
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct Checkout {
77    /// The operation at which the working copy was updated.
78    #[prost(bytes = "vec", tag = "2")]
79    pub operation_id: ::prost::alloc::vec::Vec<u8>,
80    /// An identifier for this workspace. It is used for looking up the current
81    /// working-copy commit in the repo view. Currently a human-readable name.
82    /// TODO: Is it better to make this a UUID and a have map that to a name in
83    /// config? That way users can rename a workspace.
84    #[prost(string, tag = "3")]
85    pub workspace_id: ::prost::alloc::string::String,
86}
87#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
88#[repr(i32)]
89pub enum FileType {
90    Normal = 0,
91    Symlink = 1,
92    Executable = 2,
93    Conflict = 3,
94    GitSubmodule = 4,
95}
96impl FileType {
97    /// String value of the enum field names used in the ProtoBuf definition.
98    ///
99    /// The values are not transformed in any way and thus are considered stable
100    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
101    pub fn as_str_name(&self) -> &'static str {
102        match self {
103            FileType::Normal => "Normal",
104            FileType::Symlink => "Symlink",
105            FileType::Executable => "Executable",
106            FileType::Conflict => "Conflict",
107            FileType::GitSubmodule => "GitSubmodule",
108        }
109    }
110    /// Creates an enum from field names used in the ProtoBuf definition.
111    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
112        match value {
113            "Normal" => Some(Self::Normal),
114            "Symlink" => Some(Self::Symlink),
115            "Executable" => Some(Self::Executable),
116            "Conflict" => Some(Self::Conflict),
117            "GitSubmodule" => Some(Self::GitSubmodule),
118            _ => None,
119        }
120    }
121}