Elffuss BraidHub

utopia-ia/elffuss-braid public

38b3e04f7d4a · 24.1 KiBRawPermalink
1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 UtopiaIA
3
4//! Export: braid objects back to git objects, and into a git repository.
5
6use std::collections::{HashMap, HashSet};
7use std::fmt;
8use std::path::Path;
9
10use braid_format::{Changeset, Entry, EntryKind, GitId, Kind, ObjectId, Objects};
11
12use crate::error::Error;
13use crate::fetch;
14use crate::map::{GitMap, Pairings};
15use crate::oid::{GitKind, GitOid};
16use crate::raw::{self, EntryType, TreeItem};
17use crate::repo::GitRepo;
18
19/// Produces git objects from braid objects.
20///
21/// What came from git goes back byte for byte: a changeset with a git origin
22/// is exported as its original commit, after checking that the tree and the
23/// parents the commit names are the ones the map links to the changeset; a
24/// git tree that is not canonical as its raw bytes; a tag as its raw bytes.
25///
26/// Everything else is generated deterministically from braid content alone:
27/// a tree with canonical modes and git's entry order, a commit with `tree`,
28/// `parent`, `author` and `committer` headers, one header per extra, and the
29/// message unchanged.
30///
31/// An exporter caches the git ids it computes, so exporting many related
32/// objects through one exporter does each piece of work once. Nothing is
33/// recursive: deep histories and deep directories are walked with explicit
34/// stacks. What it computed that the map does not know yet is available from
35/// [`pairings`](Self::pairings), to record in the map.
36pub struct Exporter<'a, O: Objects> {
37 objects: &'a O,
38 map: &'a GitMap,
39 /// Canonical git trees computed here, for braid trees the map does not
40 /// link to one, and back.
41 trees: HashMap<ObjectId, GitOid>,
42 tree_sources: HashMap<GitOid, ObjectId>,
43 /// Git blobs computed here, with their sizes, and back.
44 blobs: HashMap<ObjectId, (GitOid, u64)>,
45 blob_sources: HashMap<GitOid, ObjectId>,
46 /// Commits exported here, and back.
47 commits: HashMap<ObjectId, GitOid>,
48 commit_sources: HashMap<GitOid, ObjectId>,
49}
50
51impl<O: Objects> fmt::Debug for Exporter<'_, O> {
52 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
53 f.debug_struct("Exporter")
54 .field("computed_trees", &self.trees.len())
55 .field("computed_blobs", &self.blobs.len())
56 .field("computed_commits", &self.commits.len())
57 .finish_non_exhaustive()
58 }
59}
60
61impl<'a, O: Objects> Exporter<'a, O> {
62 /// An exporter reading braid objects from `objects`, with what `map`
63 /// knows about imported git objects.
64 pub fn new(objects: &'a O, map: &'a GitMap) -> Self {
65 Self {
66 objects,
67 map,
68 trees: HashMap::new(),
69 tree_sources: HashMap::new(),
70 blobs: HashMap::new(),
71 blob_sources: HashMap::new(),
72 commits: HashMap::new(),
73 commit_sources: HashMap::new(),
74 }
75 }
76
77 /// Every pairing this exporter computed that its map does not hold: the
78 /// commits of the changesets it exported, and the canonical trees and
79 /// the blobs it generated. [`GitMap::record`] adds them to a map, so that
80 /// importing these git objects later gives back the same braid objects.
81 pub fn pairings(&self) -> Pairings {
82 let mut commits: Vec<(GitOid, ObjectId)> = self
83 .commits
84 .iter()
85 .filter(|(changeset, _)| self.map.commit(changeset).is_none())
86 .map(|(changeset, oid)| (*oid, *changeset))
87 .collect();
88 let mut trees: Vec<(GitOid, ObjectId)> = self
89 .trees
90 .iter()
91 .filter(|(tree, _)| self.map.git_tree(tree).is_none())
92 .map(|(tree, oid)| (*oid, *tree))
93 .collect();
94 let mut blobs: Vec<(GitOid, ObjectId, u64)> = self
95 .blobs
96 .iter()
97 .filter(|(blob, _)| self.map.git_blob(blob).is_none())
98 .map(|(blob, (oid, size))| (*oid, *blob, *size))
99 .collect();
100 commits.sort_unstable();
101 trees.sort_unstable();
102 blobs.sort_unstable();
103 Pairings {
104 commits,
105 trees,
106 blobs,
107 }
108 }
109
110 /// The git commit of a changeset: its id and its bytes.
111 pub fn commit(&mut self, changeset: &ObjectId) -> Result<(GitOid, Vec<u8>), Error> {
112 let decoded = fetch::changeset(self.objects, changeset)?;
113 self.commit_of(changeset, &decoded)
114 }
115
116 /// The git id of a changeset's commit. Ancestors that were not imported
117 /// from git are exported first, parents before children.
118 pub fn commit_id(&mut self, changeset: &ObjectId) -> Result<GitOid, Error> {
119 if let Some(oid) = self.known_commit(changeset) {
120 return Ok(oid);
121 }
122 let mut stack = vec![(*changeset, fetch::changeset(self.objects, changeset)?)];
123 while let Some((id, decoded)) = stack.pop() {
124 if self.known_commit(&id).is_some() {
125 continue;
126 }
127 // A commit from git names its parents itself; a generated one
128 // needs theirs first.
129 let waiting = match decoded.git_origin {
130 Some(_) => None,
131 None => decoded
132 .parents
133 .iter()
134 .find(|parent| self.known_commit(parent).is_none())
135 .copied(),
136 };
137 match waiting {
138 Some(parent) => {
139 let parent_changeset = fetch::changeset(self.objects, &parent)?;
140 stack.push((id, decoded));
141 stack.push((parent, parent_changeset));
142 }
143 None => {
144 self.commit_of(&id, &decoded)?;
145 }
146 }
147 }
148 self.known_commit(changeset)
149 .ok_or_else(|| Error::NotMapped {
150 what: "changeset",
151 id: changeset.to_hex(),
152 })
153 }
154
155 fn known_commit(&self, changeset: &ObjectId) -> Option<GitOid> {
156 self.map
157 .commit(changeset)
158 .or_else(|| self.commits.get(changeset).copied())
159 }
160
161 fn commit_of(
162 &mut self,
163 id: &ObjectId,
164 changeset: &Changeset,
165 ) -> Result<(GitOid, Vec<u8>), Error> {
166 let (oid, bytes) = match &changeset.git_origin {
167 Some(origin) => self.origin_commit(id, changeset, origin)?,
168 None => {
169 let mut parents = Vec::with_capacity(changeset.parents.len());
170 for parent in &changeset.parents {
171 parents.push(self.commit_id(parent)?);
172 }
173 let tree = self.tree_id(&changeset.root)?;
174 let bytes = raw::encode_commit(
175 tree,
176 &parents,
177 &changeset.author,
178 &changeset.committer,
179 &changeset.extras,
180 &changeset.message,
181 )
182 .map_err(|detail| Error::Unrepresentable {
183 changeset: *id,
184 detail,
185 })?;
186 (GitOid::for_object(GitKind::Commit, &bytes)?, bytes)
187 }
188 };
189 self.commits.insert(*id, oid);
190 self.commit_sources.insert(oid, *id);
191 Ok((oid, bytes))
192 }
193
194 /// The original commit of a changeset imported from git, after checking
195 /// that what it names agrees with the changeset and the map.
196 fn origin_commit(
197 &self,
198 id: &ObjectId,
199 changeset: &Changeset,
200 origin: &ObjectId,
201 ) -> Result<(GitOid, Vec<u8>), Error> {
202 let mismatch = |detail: String| Error::OriginMismatch {
203 changeset: *id,
204 detail,
205 };
206 let bytes = fetch::get(self.objects, origin, Kind::Blob)?;
207 let fields = raw::parse_commit(&bytes)
208 .map_err(|reason| mismatch(format!("its git origin is not a commit: {reason}")))?;
209 match self.map.tree(&fields.tree) {
210 Some(root) if root == changeset.root => {}
211 Some(root) => {
212 return Err(mismatch(format!(
213 "its commit names tree {}, which the map links to {root}, not to its root {}",
214 fields.tree, changeset.root
215 )));
216 }
217 None => {
218 return Err(mismatch(format!(
219 "its commit names tree {}, which the map does not know",
220 fields.tree
221 )));
222 }
223 }
224 if fields.parents.len() != changeset.parents.len() {
225 return Err(mismatch(format!(
226 "its commit names {} parents, the changeset has {}",
227 fields.parents.len(),
228 changeset.parents.len()
229 )));
230 }
231 for (index, (git, braid)) in fields.parents.iter().zip(&changeset.parents).enumerate() {
232 if self.map.changeset(git) != Some(*braid) {
233 return Err(mismatch(format!(
234 "parent {index} of its commit is {git}, which the map does not link to {braid}"
235 )));
236 }
237 }
238 let oid = GitOid::for_object(GitKind::Commit, &bytes)?;
239 if let Some(known) = self.map.commit(id)
240 && known != oid
241 {
242 return Err(mismatch(format!(
243 "the map links it to commit {known}, but its git origin is commit {oid}"
244 )));
245 }
246 Ok((oid, bytes))
247 }
248
249 /// The canonical git tree of a braid tree: its id and its bytes.
250 pub fn tree(&mut self, tree: &ObjectId) -> Result<(GitOid, Vec<u8>), Error> {
251 let entries = fetch::tree_entries(self.objects, *tree)?;
252 let bytes = self.encode_entries(tree, &entries)?;
253 let oid = GitOid::for_object(GitKind::Tree, &bytes)?;
254 match self.known_tree(tree) {
255 Some(known) if known != oid => Err(Error::BadBraidObject {
256 id: *tree,
257 detail: format!("the map links it to git tree {known}, but it exports as {oid}"),
258 }),
259 Some(_) => Ok((oid, bytes)),
260 None => {
261 self.trees.insert(*tree, oid);
262 self.tree_sources.insert(oid, *tree);
263 Ok((oid, bytes))
264 }
265 }
266 }
267
268 /// The id of the canonical git tree of a braid tree.
269 pub fn tree_id(&mut self, tree: &ObjectId) -> Result<GitOid, Error> {
270 if let Some(oid) = self.known_tree(tree) {
271 return Ok(oid);
272 }
273 // Directories waiting for their subdirectories: id, entries, and the
274 // index of the next entry to look at.
275 let mut stack = vec![(*tree, fetch::tree_entries(self.objects, *tree)?, 0usize)];
276 while let Some((_, entries, next)) = stack.last_mut() {
277 let mut child = None;
278 while child.is_none() && *next < entries.len() {
279 if let EntryKind::Tree { tree } = &entries[*next].kind
280 && self.known_tree(tree).is_none()
281 {
282 child = Some(*tree);
283 }
284 *next += 1;
285 }
286 if let Some(child) = child {
287 let entries = fetch::tree_entries(self.objects, child)?;
288 stack.push((child, entries, 0));
289 continue;
290 }
291 let (id, entries, _) = stack.pop().expect("the loop runs on a non-empty stack");
292 if self.known_tree(&id).is_some() {
293 continue;
294 }
295 let bytes = self.encode_entries(&id, &entries)?;
296 let oid = GitOid::for_object(GitKind::Tree, &bytes)?;
297 self.trees.insert(id, oid);
298 self.tree_sources.insert(oid, id);
299 }
300 self.known_tree(tree).ok_or_else(|| Error::NotMapped {
301 what: "tree",
302 id: tree.to_hex(),
303 })
304 }
305
306 fn known_tree(&self, tree: &ObjectId) -> Option<GitOid> {
307 self.map
308 .git_tree(tree)
309 .or_else(|| self.trees.get(tree).copied())
310 }
311
312 /// The canonical bytes of a directory. Its subdirectories normally have
313 /// git ids already, so this does not recurse far.
314 fn encode_entries(&mut self, tree: &ObjectId, entries: &[Entry]) -> Result<Vec<u8>, Error> {
315 let mut items = Vec::with_capacity(entries.len());
316 for entry in entries {
317 let (kind, oid) = match &entry.kind {
318 EntryKind::File { blob, .. } => (EntryType::File, self.blob_id(blob)?),
319 EntryKind::Executable { blob, .. } => (EntryType::Executable, self.blob_id(blob)?),
320 EntryKind::Symlink { blob, .. } => (EntryType::Symlink, self.blob_id(blob)?),
321 EntryKind::Tree { tree } => (EntryType::Tree, self.tree_id(tree)?),
322 EntryKind::Gitlink {
323 commit: GitId::Sha1(bytes),
324 } => (EntryType::Gitlink, GitOid::from_bytes(*bytes)),
325 EntryKind::Gitlink {
326 commit: GitId::Sha256(_),
327 } => {
328 return Err(Error::BadBraidObject {
329 id: *tree,
330 detail: "a SHA-256 submodule cannot be written in a SHA-1 tree".into(),
331 });
332 }
333 };
334 items.push(TreeItem {
335 kind,
336 name: &entry.name,
337 oid,
338 });
339 }
340 Ok(raw::encode_tree(&mut items))
341 }
342
343 /// The git blob of a braid blob: its id and its content.
344 pub fn blob(&mut self, blob: &ObjectId) -> Result<(GitOid, Vec<u8>), Error> {
345 let bytes = fetch::get(self.objects, blob, Kind::Blob)?;
346 let oid = GitOid::for_object(GitKind::Blob, &bytes)?;
347 if let Some(known) = self.map.git_blob(blob)
348 && known != oid
349 {
350 return Err(Error::BadBraidObject {
351 id: *blob,
352 detail: format!("the map links it to git blob {known}, but its content is {oid}"),
353 });
354 }
355 self.blobs.insert(*blob, (oid, bytes.len() as u64));
356 self.blob_sources.insert(oid, *blob);
357 Ok((oid, bytes))
358 }
359
360 /// The id of the git blob of a braid blob.
361 pub fn blob_id(&mut self, blob: &ObjectId) -> Result<GitOid, Error> {
362 match self
363 .map
364 .git_blob(blob)
365 .or_else(|| self.blobs.get(blob).map(|(oid, _)| *oid))
366 {
367 Some(oid) => Ok(oid),
368 None => Ok(self.blob(blob)?.0),
369 }
370 }
371
372 /// Any git object the map or this exporter knows, by its git id: a commit,
373 /// a tree (raw or regenerated), a blob or an annotated tag. The bytes are
374 /// checked to hash to `oid`.
375 pub fn object(&mut self, oid: &GitOid) -> Result<(GitKind, Vec<u8>), Error> {
376 let (kind, bytes) = self.object_bytes(oid)?;
377 let found = GitOid::for_object(kind, &bytes)?;
378 if found != *oid {
379 return Err(Error::Verification {
380 oid: *oid,
381 kind,
382 detail: format!("exported as {found}"),
383 });
384 }
385 Ok((kind, bytes))
386 }
387
388 fn object_bytes(&mut self, oid: &GitOid) -> Result<(GitKind, Vec<u8>), Error> {
389 if let Some(changeset) = self
390 .map
391 .changeset(oid)
392 .or_else(|| self.commit_sources.get(oid).copied())
393 {
394 return Ok((GitKind::Commit, self.commit(&changeset)?.1));
395 }
396 if let Some(raw) = self.map.raw_tree(oid) {
397 return Ok((GitKind::Tree, fetch::get(self.objects, &raw, Kind::Blob)?));
398 }
399 if let Some(tree) = self
400 .map
401 .tree(oid)
402 .or_else(|| self.tree_sources.get(oid).copied())
403 {
404 return Ok((GitKind::Tree, self.tree(&tree)?.1));
405 }
406 if let Some(blob) = self
407 .map
408 .blob(oid)
409 .map(|(id, _)| id)
410 .or_else(|| self.blob_sources.get(oid).copied())
411 {
412 return Ok((GitKind::Blob, fetch::get(self.objects, &blob, Kind::Blob)?));
413 }
414 if let Some(entry) = self.map.tag(oid) {
415 let bytes = fetch::get(self.objects, &entry.raw, Kind::Blob)?;
416 if raw::parse_tag(&bytes).ok() != Some(entry.target) {
417 return Err(Error::Verification {
418 oid: *oid,
419 kind: GitKind::Tag,
420 detail: format!("its raw bytes do not point to {}", entry.target),
421 });
422 }
423 return Ok((GitKind::Tag, bytes));
424 }
425 Err(Error::NotMapped {
426 what: "git object",
427 id: oid.to_hex(),
428 })
429 }
430}
431
432/// The git commit of a changeset: its id and its bytes. See [`Exporter`].
433pub fn export_commit<O: Objects>(
434 objects: &O,
435 map: &GitMap,
436 changeset: &ObjectId,
437) -> Result<(GitOid, Vec<u8>), Error> {
438 Exporter::new(objects, map).commit(changeset)
439}
440
441/// The canonical git tree of a braid tree: its id and its bytes.
442pub fn export_tree<O: Objects>(
443 objects: &O,
444 map: &GitMap,
445 tree: &ObjectId,
446) -> Result<(GitOid, Vec<u8>), Error> {
447 Exporter::new(objects, map).tree(tree)
448}
449
450/// The git blob of a braid blob: its id and its content.
451pub fn export_blob<O: Objects>(
452 objects: &O,
453 map: &GitMap,
454 blob: &ObjectId,
455) -> Result<(GitOid, Vec<u8>), Error> {
456 Exporter::new(objects, map).blob(blob)
457}
458
459/// An imported git object, by its git id: its kind and its exact bytes.
460pub fn export_object<O: Objects>(
461 objects: &O,
462 map: &GitMap,
463 oid: &GitOid,
464) -> Result<(GitKind, Vec<u8>), Error> {
465 Exporter::new(objects, map).object(oid)
466}
467
468/// What a ref written by [`write_to_repo`] points to.
469#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
470pub enum RefTarget {
471 /// A changeset, written as a commit.
472 Changeset(ObjectId),
473 /// A git object the map knows: a commit, an annotated tag, a tree or a
474 /// blob.
475 Git(GitOid),
476}
477
478/// A ref to set in [`write_to_repo`], which overwrites it without a lease.
479#[derive(Clone, Debug, PartialEq, Eq, Hash)]
480pub struct RefUpdate {
481 /// The full ref name, such as `refs/heads/main`.
482 pub name: Vec<u8>,
483 /// What it points to.
484 pub target: RefTarget,
485}
486
487/// What [`write_to_repo`] did.
488#[derive(Clone, Debug, Default, PartialEq, Eq)]
489pub struct WriteReport {
490 /// Commits written.
491 pub commits: usize,
492 /// Trees written.
493 pub trees: usize,
494 /// Blobs written.
495 pub blobs: usize,
496 /// Annotated tags written.
497 pub tags: usize,
498 /// Each ref and the object it points to now.
499 pub refs: Vec<(Vec<u8>, GitOid)>,
500}
501
502/// Writes into the git repository at `git_repo` every object the refs need,
503/// then points the refs at them in one transaction.
504///
505/// Refs are overwritten, whatever they pointed to before: there is no lease
506/// and no fast-forward check here. That is meant for local exports and for a
507/// mirror; updating a shared repository with a lease, as a fast-forward, is
508/// the job of `braid git sync`, which pushes from such a mirror.
509///
510/// Objects the repository already has are not written again, and neither is
511/// anything they reach. Objects are written after everything they reach, so an
512/// interrupted write never leaves an object whose closure is missing.
513///
514/// The map is not changed: [`write_to_repo_recording`] also records what the
515/// export generated.
516pub fn write_to_repo<O: Objects>(
517 git_repo: &Path,
518 objects: &O,
519 map: &GitMap,
520 refs: &[RefUpdate],
521) -> Result<WriteReport, Error> {
522 write(git_repo, objects, map, refs).map(|(report, _)| report)
523}
524
525/// [`write_to_repo`], then records in `map` every commit, canonical tree and
526/// blob the export generated (see [`Exporter::pairings`]), so that importing
527/// them again, from this repository or from any other that received them,
528/// gives back the same braid objects instead of new ones.
529///
530/// Nothing is recorded when the write fails. The caller saves the map.
531pub fn write_to_repo_recording<O: Objects>(
532 git_repo: &Path,
533 objects: &O,
534 map: &mut GitMap,
535 refs: &[RefUpdate],
536) -> Result<WriteReport, Error> {
537 let (report, pairings) = write(git_repo, objects, map, refs)?;
538 map.record(&pairings);
539 Ok(report)
540}
541
542/// Writes the objects and the refs, and returns what the export generated.
543fn write<O: Objects>(
544 git_repo: &Path,
545 objects: &O,
546 map: &GitMap,
547 refs: &[RefUpdate],
548) -> Result<(WriteReport, Pairings), Error> {
549 let mut repo = GitRepo::open(git_repo)?;
550 let mut writer = Writer {
551 exporter: Exporter::new(objects, map),
552 repo: &repo,
553 written: HashSet::new(),
554 report: WriteReport::default(),
555 };
556 let mut targets = Vec::with_capacity(refs.len());
557 for update in refs {
558 let oid = match update.target {
559 RefTarget::Changeset(changeset) => writer.exporter.commit_id(&changeset)?,
560 RefTarget::Git(oid) => oid,
561 };
562 writer.write_closure(oid)?;
563 targets.push((update.name.clone(), oid));
564 }
565 let pairings = writer.exporter.pairings();
566 let mut report = writer.report;
567 repo.set_refs(&targets, "braid: export")?;
568 report.refs = targets;
569 Ok((report, pairings))
570}
571
572struct Writer<'r, 'a, O: Objects> {
573 exporter: Exporter<'a, O>,
574 repo: &'r GitRepo,
575 written: HashSet<GitOid>,
576 report: WriteReport,
577}
578
579/// An object waiting for what it reaches to be written.
580struct Pending {
581 oid: GitOid,
582 kind: GitKind,
583 bytes: Vec<u8>,
584 children: Vec<GitOid>,
585 next: usize,
586}
587
588impl<O: Objects> Writer<'_, '_, O> {
589 fn present(&self, oid: &GitOid) -> bool {
590 self.written.contains(oid) || self.repo.contains(oid)
591 }
592
593 fn pending(&mut self, oid: GitOid) -> Result<Pending, Error> {
594 let (kind, bytes) = self.exporter.object(&oid)?;
595 let children = reached(oid, kind, &bytes)?;
596 Ok(Pending {
597 oid,
598 kind,
599 bytes,
600 children,
601 next: 0,
602 })
603 }
604
605 fn write_closure(&mut self, root: GitOid) -> Result<(), Error> {
606 if self.present(&root) {
607 return Ok(());
608 }
609 let mut stack = vec![self.pending(root)?];
610 while let Some(top) = stack.last_mut() {
611 if top.next < top.children.len() {
612 let child = top.children[top.next];
613 top.next += 1;
614 if !self.present(&child) {
615 let pending = self.pending(child)?;
616 stack.push(pending);
617 }
618 continue;
619 }
620 let done = stack.pop().expect("the loop runs on a non-empty stack");
621 if self.present(&done.oid) {
622 continue;
623 }
624 let stored = self.repo.write(done.kind, &done.bytes)?;
625 if stored != done.oid {
626 return Err(Error::Verification {
627 oid: done.oid,
628 kind: done.kind,
629 detail: format!("the repository stored it as {stored}"),
630 });
631 }
632 self.written.insert(done.oid);
633 match done.kind {
634 GitKind::Commit => self.report.commits += 1,
635 GitKind::Tree => self.report.trees += 1,
636 GitKind::Blob => self.report.blobs += 1,
637 GitKind::Tag => self.report.tags += 1,
638 }
639 }
640 Ok(())
641 }
642}
643
644/// The objects a git object names: a commit's tree and parents, a tree's
645/// entries except submodules, a tag's target.
646pub(crate) fn reached(oid: GitOid, kind: GitKind, bytes: &[u8]) -> Result<Vec<GitOid>, Error> {
647 let malformed = |reason| Error::Malformed { oid, kind, reason };
648 Ok(match kind {
649 GitKind::Commit => {
650 let fields = raw::parse_commit(bytes).map_err(malformed)?;
651 let mut out = Vec::with_capacity(1 + fields.parents.len());
652 out.push(fields.tree);
653 out.extend(fields.parents);
654 out
655 }
656 GitKind::Tree => {
657 let mut out = Vec::new();
658 for entry in raw::parse_tree(bytes).map_err(malformed)? {
659 match EntryType::from_mode(entry.mode) {
660 Some(EntryType::Gitlink) => {}
661 Some(_) => out.push(entry.oid),
662 None => return Err(malformed("an entry has an unsupported mode")),
663 }
664 }
665 out
666 }
667 GitKind::Tag => vec![raw::parse_tag(bytes).map_err(malformed)?],
668 GitKind::Blob => Vec::new(),
669 })
670}