| 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 simple_op_store; |
| 18 |
|
| 19 |
message RefConflictLegacy { |
| 20 |
repeated bytes removes = 1 [deprecated = true]; |
| 21 |
repeated bytes adds = 2 [deprecated = true]; |
| 22 |
} |
| 23 |
|
| 24 |
// This is redundant with `RefTargetTerm`. It exists for historical reasons. |
| 25 |
// TODO: Consider deprecating it. |
| 26 |
message RefConflict { |
| 27 |
message Term { |
| 28 |
optional bytes value = 1; |
| 29 |
} |
| 30 |
repeated Term removes = 1; |
| 31 |
repeated Term adds = 2; |
| 32 |
} |
| 33 |
|
| 34 |
// RefTarget that may be serialized in legacy form. |
| 35 |
message RefTarget { |
| 36 |
// New `RefConflict` type represents both `commit_id` and `conflict_legacy`. |
| 37 |
oneof value { |
| 38 |
bytes commit_id = 1 [deprecated = true]; |
| 39 |
RefConflictLegacy conflict_legacy = 2 [deprecated = true]; |
| 40 |
RefConflict conflict = 3; |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
// RefTarget term that should be serialized in native form, in which positive |
| 45 |
// and negative terms alternate. |
| 46 |
message RefTargetTerm { |
| 47 |
optional bytes value = 1; |
| 48 |
} |
| 49 |
|
| 50 |
enum RemoteRefState { |
| 51 |
New = 0; |
| 52 |
Tracked = 1; |
| 53 |
} |
| 54 |
|
| 55 |
message RemoteBookmark { |
| 56 |
string remote_name = 1; |
| 57 |
RefTarget target = 2; |
| 58 |
// Introduced in jj 0.11. |
| 59 |
optional RemoteRefState state = 3; |
| 60 |
} |
| 61 |
|
| 62 |
message Bookmark { |
| 63 |
string name = 1; |
| 64 |
// Unset if the bookmark has been deleted locally. |
| 65 |
RefTarget local_target = 2; |
| 66 |
// Deprecated since jj 0.34. |
| 67 |
repeated RemoteBookmark remote_bookmarks = 3 [deprecated = true]; |
| 68 |
} |
| 69 |
|
| 70 |
message GitRef { |
| 71 |
string name = 1; |
| 72 |
// This field is just for historical reasons (before we had the RefTarget |
| 73 |
// type). New GitRefs have (only) the target field. |
| 74 |
// TODO: Delete support for the old format. |
| 75 |
bytes commit_id = 2 [deprecated = true]; |
| 76 |
RefTarget target = 3; |
| 77 |
} |
| 78 |
|
| 79 |
message GitHead { |
| 80 |
string name = 1; |
| 81 |
RefTarget target = 2; |
| 82 |
} |
| 83 |
|
| 84 |
message RemoteRef { |
| 85 |
string name = 1; |
| 86 |
repeated RefTargetTerm target_terms = 2; |
| 87 |
RemoteRefState state = 3; |
| 88 |
} |
| 89 |
|
| 90 |
message Tag { |
| 91 |
string name = 1; |
| 92 |
RefTarget target = 2; |
| 93 |
} |
| 94 |
|
| 95 |
message View { |
| 96 |
repeated bytes head_ids = 1; |
| 97 |
reserved 4; |
| 98 |
bytes wc_commit_id = 2 [deprecated = true]; |
| 99 |
map<string, bytes> wc_commit_ids = 8; |
| 100 |
// Local bookmarks and remote bookmarks in legacy form. |
| 101 |
repeated Bookmark bookmarks = 5; |
| 102 |
repeated Tag local_tags = 6; |
| 103 |
// Introduced in jj 0.34. |
| 104 |
repeated RemoteView remote_views = 11; |
| 105 |
// Only a subset of the refs. For example, does not include refs/notes/. |
| 106 |
repeated GitRef git_refs = 3; |
| 107 |
// This field is just for historical reasons (before we had the RefTarget |
| 108 |
// type). New Views have (only) the target field. |
| 109 |
// TODO: Delete support for the old format. |
| 110 |
bytes git_head_legacy = 7 [deprecated = true]; |
| 111 |
RefTarget git_head = 9 [deprecated = true]; |
| 112 |
// Whether "@git" tags have been migrated to remote_views. |
| 113 |
bool has_git_refs_migrated_to_remote_tags = 12; |
| 114 |
// Per-workspace Git HEAD targets, keyed by workspace name. |
| 115 |
repeated GitHead git_heads = 13; |
| 116 |
reserved 10; |
| 117 |
} |
| 118 |
|
| 119 |
message RemoteView { |
| 120 |
string name = 1; |
| 121 |
repeated RemoteRef bookmarks = 2; |
| 122 |
repeated RemoteRef tags = 3; |
| 123 |
} |
| 124 |
|
| 125 |
message Operation { |
| 126 |
bytes view_id = 1; |
| 127 |
repeated bytes parents = 2; |
| 128 |
OperationMetadata metadata = 3; |
| 129 |
// Introduced in jj 0.30. |
| 130 |
repeated CommitPredecessors commit_predecessors = 4; |
| 131 |
// Whether or not `commit_predecessors` is recorded. |
| 132 |
bool stores_commit_predecessors = 5; |
| 133 |
} |
| 134 |
|
| 135 |
// TODO: Share with store.proto? Do we even need the timezone here? |
| 136 |
message Timestamp { |
| 137 |
int64 millis_since_epoch = 1; |
| 138 |
int32 tz_offset = 2; |
| 139 |
} |
| 140 |
|
| 141 |
message OperationMetadata { |
| 142 |
Timestamp start_time = 1; |
| 143 |
Timestamp end_time = 2; |
| 144 |
string description = 3; |
| 145 |
string hostname = 4; |
| 146 |
string username = 5; |
| 147 |
bool is_snapshot = 7; |
| 148 |
optional string workspace_name = 8; |
| 149 |
map<string, string> attributes = 6; |
| 150 |
} |
| 151 |
|
| 152 |
message CommitPredecessors { |
| 153 |
bytes commit_id = 1; |
| 154 |
repeated bytes predecessor_ids = 2; |
| 155 |
} |