jj/lib/protos/working_copy.proto
Martin von Zweigbergk ceb6c152a1 working_copy: record sparse patterns in the tree state (#52)
This patch makes room for sparse patterns in the `TreeState` proto
message. We also start setting that value to a list of just the
pattern `.` when we create new working copies. Old working copies
without the sparse patterns are also interpreted as having that single
pattern. Note that this absence of sparse patterns is different from a
present list of no patterns. The latter is a valid state and means
that no paths are included in the sparse checkout.
2022-04-26 14:52:17 -07:00

55 lines
1.6 KiB
Protocol Buffer

// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
enum FileType {
Normal = 0;
Symlink = 1;
Executable = 2;
Conflict = 3;
}
message FileState {
uint64 mtime_millis_since_epoch = 1;
uint64 size = 2;
FileType file_type = 3;
// Set only if file_type is Conflict
bytes conflict_id = 4;
}
message SparsePatterns {
repeated string prefixes = 1;
}
message TreeState {
bytes tree_id = 1;
map<string, FileState> file_states = 2;
SparsePatterns sparse_patterns = 3;
}
message Checkout {
// The operation at which the working copy was updated.
bytes operation_id = 2;
// An identifier for this workspace. It is used for looking up the current
// checkout in the repo view. Currently a human-readable name.
// TODO: Is it better to make this a UUID and a have map that to a name in
// config? That way users can rename a workspace.
string workspace_id = 3;
// The checked-out commit, which can be viewed as a cache of the checkout
// recorded in `operation_id`'s operation. No longer used.
// TODO: Delete this mid 2022 or so
bytes commit_id = 1;
}