jujutsu_lib/protos/
working_copy.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct FileState {
4    #[prost(int64, tag = "1")]
5    pub mtime_millis_since_epoch: i64,
6    #[prost(uint64, tag = "2")]
7    pub size: u64,
8    #[prost(enumeration = "FileType", tag = "3")]
9    pub file_type: i32,
10    /// Set only if file_type is Conflict
11    #[prost(bytes = "vec", tag = "4")]
12    pub conflict_id: ::prost::alloc::vec::Vec<u8>,
13}
14#[allow(clippy::derive_partial_eq_without_eq)]
15#[derive(Clone, PartialEq, ::prost::Message)]
16pub struct SparsePatterns {
17    #[prost(string, repeated, tag = "1")]
18    pub prefixes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
19}
20#[allow(clippy::derive_partial_eq_without_eq)]
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct TreeState {
23    #[prost(bytes = "vec", tag = "1")]
24    pub tree_id: ::prost::alloc::vec::Vec<u8>,
25    #[prost(map = "string, message", tag = "2")]
26    pub file_states: ::std::collections::HashMap<
27        ::prost::alloc::string::String,
28        FileState,
29    >,
30    #[prost(message, optional, tag = "3")]
31    pub sparse_patterns: ::core::option::Option<SparsePatterns>,
32}
33#[allow(clippy::derive_partial_eq_without_eq)]
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct Checkout {
36    /// The operation at which the working copy was updated.
37    #[prost(bytes = "vec", tag = "2")]
38    pub operation_id: ::prost::alloc::vec::Vec<u8>,
39    /// An identifier for this workspace. It is used for looking up the current
40    /// working-copy commit in the repo view. Currently a human-readable name.
41    /// TODO: Is it better to make this a UUID and a have map that to a name in
42    /// config? That way users can rename a workspace.
43    #[prost(string, tag = "3")]
44    pub workspace_id: ::prost::alloc::string::String,
45    /// The checked-out commit, which can be viewed as a cache of the working-copy
46    /// commit ID recorded in `operation_id`'s operation. No longer used.
47    /// TODO: Delete this mid 2022 or so
48    #[prost(bytes = "vec", tag = "1")]
49    pub commit_id: ::prost::alloc::vec::Vec<u8>,
50}
51#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
52#[repr(i32)]
53pub enum FileType {
54    Normal = 0,
55    Symlink = 1,
56    Executable = 2,
57    Conflict = 3,
58    GitSubmodule = 4,
59}
60impl FileType {
61    /// String value of the enum field names used in the ProtoBuf definition.
62    ///
63    /// The values are not transformed in any way and thus are considered stable
64    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
65    pub fn as_str_name(&self) -> &'static str {
66        match self {
67            FileType::Normal => "Normal",
68            FileType::Symlink => "Symlink",
69            FileType::Executable => "Executable",
70            FileType::Conflict => "Conflict",
71            FileType::GitSubmodule => "GitSubmodule",
72        }
73    }
74    /// Creates an enum from field names used in the ProtoBuf definition.
75    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
76        match value {
77            "Normal" => Some(Self::Normal),
78            "Symlink" => Some(Self::Symlink),
79            "Executable" => Some(Self::Executable),
80            "Conflict" => Some(Self::Conflict),
81            "GitSubmodule" => Some(Self::GitSubmodule),
82            _ => None,
83        }
84    }
85}