Advertisement
Guest User

Untitled

a guest
Jan 11th, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 6.27 KB | None | 0 0
  1. $ pijul patch 6E7KeeqoxngvDnPvBbQDSeMvWZLN2qUMUvDnF8wADb42iZtLFWHbQSf7YAyx5D37ZuoRY3W2B5opjUJt5ZPHGUpY
  2. After line 5:
  3. - use libpijul::{HashRef, PatchId, Repository};
  4. In pijul/src/commands/log.rs:
  5. Deleted in a subsequent patch:
  6. + use libpijul::{PatchId, Branch, Txn};
  7. After line 6:
  8. - use libpijul::{PatchId, Txn};
  9. After line 10:
  10. - use std::io::Read;
  11. In pijul/src/commands/log.rs:
  12. Deleted in a subsequent patch:
  13. +
  14. After line 11:
  15. - use std::path::Path;
  16. In pijul/src/commands/log.rs:
  17. From line 71:
  18. +
  19. In pijul/src/commands/log.rs:
  20. From line 98:
  21. +
  22. After line 138:
  23. -     fn display_patch_(&self, txn: &Txn, nth: u64, patchid: PatchId) -> Result<(), Error> {
  24. In pijul/src/commands/log.rs:
  25. Deleted in a subsequent patch:
  26. +     fn display_patch_(&self, txn: &Txn, branch: &Branch, nth: u64, patchid: PatchId) -> Result<(), Error> {
  27. After line 137:
  28. -     hash_ext: HashRef,
  29. -     repo: &Repository,
  30. -     branch_name: &String,
  31. - ) -> Result<(), Error> {
  32. After line 169:
  33. -             Ok(())
  34. After line 180:
  35. -             Ok(())
  36. In pijul/src/commands/log.rs:
  37. From line 180:
  38. +         }
  39. +
  40. +         if self.show_patches {
  41. +             let mut patch_path = self.opts.repo_root.patches_dir().join(hash_ext.to_base58());
  42. +             patch_path.set_extension("gz");
  43. +             let f = File::open(&patch_path)?;
  44. +
  45. +             let mut f = BufReader::new(f);
  46. +             let (hash, _, patch) = Patch::from_reader_compressed(&mut f)?;
  47. +
  48. +             print_patch(&hash, &patch, txn, branch)?;
  49. +             println!();
  50. In pijul/src/commands/log.rs:
  51. From line 193:
  52. +
  53. +         Ok(())
  54. After line 197:
  55. -     fn display_patch(&self, txn: &Txn, n: u64, patchid: PatchId) -> Result<(), Error> {
  56. In pijul/src/commands/log.rs:
  57. Deleted in a subsequent patch:
  58. +     fn display_patch(&self, txn: &Txn, branch: &Branch, n: u64, patchid: PatchId) -> Result<(), Error> {
  59. After line 205:
  60. -             self.display_patch_(&txn, n, patchid)?;
  61. In pijul/src/commands/log.rs:
  62. From line 205:
  63. +             self.display_patch_(txn, branch, n, patchid)?;
  64. After line 215:
  65. -                     self.display_patch_(&txn, n, patchid)?;
  66. In pijul/src/commands/log.rs:
  67. From line 215:
  68. +                     self.display_patch_(txn, branch, n, patchid)?;
  69. After line 197:
  70. -         ask::print_patch_descr(&mut term, &hash_ext.to_owned(), Some(patchid), &patch);
  71. In pijul/src/commands/log.rs:
  72. From line 220:
  73. +         Ok(())
  74. +     }
  75. After line 223:
  76. -         if settings.show_patches {
  77. -             let mut patch_path = settings.opts.repo_root.patches_dir().join(hash_ext.to_base58());
  78. -             patch_path.set_extension("gz");
  79. -             let f = File::open(&patch_path)?;
  80. -
  81. -             let mut f = BufReader::new(f);
  82. -             let (hash, _, patch) = Patch::from_reader_compressed(&mut f)?;
  83. -
  84. -             print_patch(&hash, &patch, &repo, branch_name)?;
  85. -             println!();
  86. -         }
  87. -
  88. -         Ok(())
  89. In pijul/src/commands/log.rs:
  90. From line 223:
  91. +     fn is_touched(&self, txn: &Txn, patchid: PatchId) -> bool {
  92. Deleted in a subsequent patch:
  93. +         self.path.is_empty() ||
  94. Deleted in a subsequent patch:
  95. +             self.path.iter().any(|path| {
  96. From line 226:
  97. +                 if let Ok(inode) = txn.find_inode(&path) {
  98. +                     if let Some(key) = txn.get_inodes(inode) {
  99. Deleted in a subsequent patch:
  100. +                         return txn.get_touched(key.key, patchid)
  101. From line 229:
  102. +                     }
  103. +                 }
  104. +                 false
  105. +             })
  106. In pijul/src/commands/log.rs:
  107. From line 261:
  108. +                 .filter(|(_, patchid)| {
  109. +                     // Only select patches that touch the input path
  110. +                     // (if that path exists).
  111. +                     settings.is_touched(&txn, *patchid)
  112. +                 })
  113. In pijul/src/commands/log.rs:
  114. From line 270:
  115. +         debug!("start {:?}", start);
  116. After line 277:
  117. -             settings.display_patch(&txn, applied, patchid)?
  118. In pijul/src/commands/log.rs:
  119. From line 277:
  120. +             settings.display_patch(&txn, &branch, applied, patchid)?
  121. After line 282:
  122. -     let repo = settings.opts.open_repo()?;
  123. After line 283:
  124. -     let branch_name = &settings.opts.branch();
  125. -     let branch = match txn.get_branch(branch_name) {
  126. -         Some(b) => b,
  127. After line 285:
  128. -             settings.display_patch(&txn, n as u64, patchid)?;
  129. -             let hash_ext = txn.get_external(patchid).unwrap();
  130. -             display_patch(&settings, n, patchid, hash_ext, &repo, branch_name)?;
  131. In pijul/src/commands/log.rs:
  132. From line 285:
  133. +             settings.display_patch(&txn, &branch, n as u64, patchid)?;
  134. In pijul/src/commands/log.rs:
  135. Deleted in a subsequent patch:
  136. +                 .filter(|(_, patchid)| {
  137. Deleted in a subsequent patch:
  138. +                     settings.is_touched(&txn, *patchid)
  139. Deleted in a subsequent patch:
  140. +                 })
  141. After line 287:
  142. -                     debug!("hash: {:?}", hash_ext.to_base58());
  143. -                     display_patch(&settings, n, patchid, hash_ext, &repo, branch_name)?;
  144. After line 303:
  145. -             settings.display_patch(&txn, applied, patchid)?;
  146. In pijul/src/commands/log.rs:
  147. From line 303:
  148. +             settings.display_patch(&txn, &branch, applied, patchid)?;
  149. After line 305:
  150. -             display_patch(&settings, n, patchid, hash_ext, &repo, branch_name)?;
  151. -         }
  152. After line 10:
  153. - use libpijul::{Branch, EdgeFlags, Hash, Key, LineId, PatchId, Repository, Transaction, Txn, Value, ROOT_KEY};
  154. In pijul/src/commands/patch.rs:
  155. From line 10:
  156. + use libpijul::{Branch, EdgeFlags, Hash, Key, LineId, PatchId, Transaction, Txn, Value, ROOT_KEY};
  157. After line 118:
  158. -                 print_patch(&hash, &patch, &repo, &branch_name)?
  159. In pijul/src/commands/patch.rs:
  160. From line 118:
  161. +                 let txn = repo.txn_begin()?;
  162. +                 let branch = txn.get_branch(&branch_name).expect("Branch not found");
  163. +                 print_patch(&hash, &patch, &txn, &branch)?
  164. After line 127:
  165. -     repo: &Repository,
  166. -     branch_name: &String,
  167. In pijul/src/commands/patch.rs:
  168. Deleted in a subsequent patch:
  169. +     txn: &Txn,
  170. Deleted in a subsequent patch:
  171. +     branch: &Branch,
  172. After line 127:
  173. -     let txn = repo.txn_begin()?;
  174. -     let branch = txn.get_branch(branch_name).expect("Branch not found");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement