Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Jan 24, 2024
1 parent be376c3 commit dbdac6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion breezy/bzr/groupcompress_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def _build_vf(self, index_name, parents, delta, for_write=False):
add_callback = index.add_nodes
else:
indices = []
for pack in self.packs: # noqa: F402
for pack in self.packs:
sub_index = getattr(pack, index_name)
index_to_pack[sub_index] = pack.access_tuple()
indices.append(sub_index)
Expand Down
12 changes: 12 additions & 0 deletions src/tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@ use bazaar::RevisionId;
use std::collections::HashMap;
use std::collections::HashSet;

#[derive(Debug)]
pub enum Error {
NoSuchTag(String),
TagAlreadyExists(String),
}

impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::NoSuchTag(tag) => write!(f, "No such tag: {}", tag),
Error::TagAlreadyExists(tag) => write!(f, "Tag already exists: {}", tag),
}
}
}

impl std::error::Error for Error {}

pub trait Tags {
fn get_tag_dict(&self) -> HashMap<String, RevisionId>;

Expand Down

0 comments on commit dbdac6a

Please sign in to comment.