Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ pijul patch 6E7KeeqoxngvDnPvBbQDSeMvWZLN2qUMUvDnF8wADb42iZtLFWHbQSf7YAyx5D37ZuoRY3W2B5opjUJt5ZPHGUpY
- After line 5:
- - use libpijul::{HashRef, PatchId, Repository};
- In pijul/src/commands/log.rs:
- Deleted in a subsequent patch:
- + use libpijul::{PatchId, Branch, Txn};
- After line 6:
- - use libpijul::{PatchId, Txn};
- After line 10:
- - use std::io::Read;
- In pijul/src/commands/log.rs:
- Deleted in a subsequent patch:
- +
- After line 11:
- - use std::path::Path;
- In pijul/src/commands/log.rs:
- From line 71:
- +
- In pijul/src/commands/log.rs:
- From line 98:
- +
- After line 138:
- - fn display_patch_(&self, txn: &Txn, nth: u64, patchid: PatchId) -> Result<(), Error> {
- In pijul/src/commands/log.rs:
- Deleted in a subsequent patch:
- + fn display_patch_(&self, txn: &Txn, branch: &Branch, nth: u64, patchid: PatchId) -> Result<(), Error> {
- After line 137:
- - hash_ext: HashRef,
- - repo: &Repository,
- - branch_name: &String,
- - ) -> Result<(), Error> {
- After line 169:
- - Ok(())
- After line 180:
- - Ok(())
- In pijul/src/commands/log.rs:
- From line 180:
- + }
- +
- + if self.show_patches {
- + let mut patch_path = self.opts.repo_root.patches_dir().join(hash_ext.to_base58());
- + patch_path.set_extension("gz");
- + let f = File::open(&patch_path)?;
- +
- + let mut f = BufReader::new(f);
- + let (hash, _, patch) = Patch::from_reader_compressed(&mut f)?;
- +
- + print_patch(&hash, &patch, txn, branch)?;
- + println!();
- In pijul/src/commands/log.rs:
- From line 193:
- +
- + Ok(())
- After line 197:
- - fn display_patch(&self, txn: &Txn, n: u64, patchid: PatchId) -> Result<(), Error> {
- In pijul/src/commands/log.rs:
- Deleted in a subsequent patch:
- + fn display_patch(&self, txn: &Txn, branch: &Branch, n: u64, patchid: PatchId) -> Result<(), Error> {
- After line 205:
- - self.display_patch_(&txn, n, patchid)?;
- In pijul/src/commands/log.rs:
- From line 205:
- + self.display_patch_(txn, branch, n, patchid)?;
- After line 215:
- - self.display_patch_(&txn, n, patchid)?;
- In pijul/src/commands/log.rs:
- From line 215:
- + self.display_patch_(txn, branch, n, patchid)?;
- After line 197:
- - ask::print_patch_descr(&mut term, &hash_ext.to_owned(), Some(patchid), &patch);
- In pijul/src/commands/log.rs:
- From line 220:
- + Ok(())
- + }
- After line 223:
- - if settings.show_patches {
- - let mut patch_path = settings.opts.repo_root.patches_dir().join(hash_ext.to_base58());
- - patch_path.set_extension("gz");
- - let f = File::open(&patch_path)?;
- -
- - let mut f = BufReader::new(f);
- - let (hash, _, patch) = Patch::from_reader_compressed(&mut f)?;
- -
- - print_patch(&hash, &patch, &repo, branch_name)?;
- - println!();
- - }
- -
- - Ok(())
- In pijul/src/commands/log.rs:
- From line 223:
- + fn is_touched(&self, txn: &Txn, patchid: PatchId) -> bool {
- Deleted in a subsequent patch:
- + self.path.is_empty() ||
- Deleted in a subsequent patch:
- + self.path.iter().any(|path| {
- From line 226:
- + if let Ok(inode) = txn.find_inode(&path) {
- + if let Some(key) = txn.get_inodes(inode) {
- Deleted in a subsequent patch:
- + return txn.get_touched(key.key, patchid)
- From line 229:
- + }
- + }
- + false
- + })
- In pijul/src/commands/log.rs:
- From line 261:
- + .filter(|(_, patchid)| {
- + // Only select patches that touch the input path
- + // (if that path exists).
- + settings.is_touched(&txn, *patchid)
- + })
- In pijul/src/commands/log.rs:
- From line 270:
- + debug!("start {:?}", start);
- After line 277:
- - settings.display_patch(&txn, applied, patchid)?
- In pijul/src/commands/log.rs:
- From line 277:
- + settings.display_patch(&txn, &branch, applied, patchid)?
- After line 282:
- - let repo = settings.opts.open_repo()?;
- After line 283:
- - let branch_name = &settings.opts.branch();
- - let branch = match txn.get_branch(branch_name) {
- - Some(b) => b,
- After line 285:
- - settings.display_patch(&txn, n as u64, patchid)?;
- - let hash_ext = txn.get_external(patchid).unwrap();
- - display_patch(&settings, n, patchid, hash_ext, &repo, branch_name)?;
- In pijul/src/commands/log.rs:
- From line 285:
- + settings.display_patch(&txn, &branch, n as u64, patchid)?;
- In pijul/src/commands/log.rs:
- Deleted in a subsequent patch:
- + .filter(|(_, patchid)| {
- Deleted in a subsequent patch:
- + settings.is_touched(&txn, *patchid)
- Deleted in a subsequent patch:
- + })
- After line 287:
- - debug!("hash: {:?}", hash_ext.to_base58());
- - display_patch(&settings, n, patchid, hash_ext, &repo, branch_name)?;
- After line 303:
- - settings.display_patch(&txn, applied, patchid)?;
- In pijul/src/commands/log.rs:
- From line 303:
- + settings.display_patch(&txn, &branch, applied, patchid)?;
- After line 305:
- - display_patch(&settings, n, patchid, hash_ext, &repo, branch_name)?;
- - }
- After line 10:
- - use libpijul::{Branch, EdgeFlags, Hash, Key, LineId, PatchId, Repository, Transaction, Txn, Value, ROOT_KEY};
- In pijul/src/commands/patch.rs:
- From line 10:
- + use libpijul::{Branch, EdgeFlags, Hash, Key, LineId, PatchId, Transaction, Txn, Value, ROOT_KEY};
- After line 118:
- - print_patch(&hash, &patch, &repo, &branch_name)?
- In pijul/src/commands/patch.rs:
- From line 118:
- + let txn = repo.txn_begin()?;
- + let branch = txn.get_branch(&branch_name).expect("Branch not found");
- + print_patch(&hash, &patch, &txn, &branch)?
- After line 127:
- - repo: &Repository,
- - branch_name: &String,
- In pijul/src/commands/patch.rs:
- Deleted in a subsequent patch:
- + txn: &Txn,
- Deleted in a subsequent patch:
- + branch: &Branch,
- After line 127:
- - let txn = repo.txn_begin()?;
- - let branch = txn.get_branch(branch_name).expect("Branch not found");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement