| 1 |
// Copyright 2020 The Jujutsu Authors |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// https://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
syntax = "proto3"; |
| 16 |
|
| 17 |
package local_working_copy; |
| 18 |
|
| 19 |
enum FileType { |
| 20 |
Normal = 0; |
| 21 |
Symlink = 1; |
| 22 |
Executable = 2; |
| 23 |
Conflict = 3 [deprecated = true]; |
| 24 |
GitSubmodule = 4; |
| 25 |
} |
| 26 |
|
| 27 |
message MaterializedConflictData { |
| 28 |
// TODO: maybe we should store num_sides here as well |
| 29 |
uint32 conflict_marker_len = 1; |
| 30 |
} |
| 31 |
|
| 32 |
message FileState { |
| 33 |
int64 mtime_millis_since_epoch = 1; |
| 34 |
uint64 size = 2; |
| 35 |
FileType file_type = 3; |
| 36 |
MaterializedConflictData materialized_conflict_data = 5; |
| 37 |
reserved 4; |
| 38 |
} |
| 39 |
|
| 40 |
message FileStateEntry { |
| 41 |
string path = 1; |
| 42 |
FileState state = 2; |
| 43 |
} |
| 44 |
|
| 45 |
message SparsePatterns { |
| 46 |
repeated string prefixes = 1; |
| 47 |
} |
| 48 |
|
| 49 |
message TreeState { |
| 50 |
bytes legacy_tree_id = 1 [deprecated = true]; |
| 51 |
// Alternating positive and negative terms if there's a conflict, otherwise a |
| 52 |
// single (positive) value |
| 53 |
repeated bytes tree_ids = 5; |
| 54 |
// Labels for the terms of a conflict. |
| 55 |
repeated string conflict_labels = 7; |
| 56 |
repeated FileStateEntry file_states = 2; |
| 57 |
bool is_file_states_sorted = 6; |
| 58 |
SparsePatterns sparse_patterns = 3; |
| 59 |
WatchmanClock watchman_clock = 4; |
| 60 |
} |
| 61 |
|
| 62 |
message WatchmanClock { |
| 63 |
oneof watchman_clock { |
| 64 |
string string_clock = 1; |
| 65 |
int64 unix_timestamp = 2; |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
message Checkout { |
| 70 |
// The operation at which the working copy was updated. |
| 71 |
bytes operation_id = 2; |
| 72 |
// An identifier for this workspace. It is used for looking up the current |
| 73 |
// working-copy commit in the repo view. Currently a human-readable name. |
| 74 |
// TODO: Is it better to make this a UUID and a have map that to a name in |
| 75 |
// config? That way users can rename a workspace. |
| 76 |
string workspace_name = 3; |
| 77 |
reserved 1; |
| 78 |
} |