creating a whole new commit object that's exactly like the old one
except for the commit message.)
- The L{Immutable} class doesn't acytually enforce immutability --
+ The L{Immutable} class doesn't actually enforce immutability --
that is up to the individual immutable subclasses. It just serves
as documentation."""
return None
finally:
index.delete()
- def apply(self, tree, patch_text):
+ def apply(self, tree, patch_text, quiet):
"""Given a L{Tree} and a patch, will either return the new L{Tree}
that results when the patch is applied, or None if the patch
couldn't be applied."""
try:
index.read_tree(tree)
try:
- index.apply(patch_text)
+ index.apply(patch_text, quiet)
return index.write_tree()
except MergeException:
return None
"""In-index merge, no worktree involved."""
self.run(['git', 'read-tree', '-m', '-i', '--aggressive',
base.sha1, ours.sha1, theirs.sha1]).no_output()
- def apply(self, patch_text):
+ def apply(self, patch_text, quiet):
"""In-index patch application, no worktree involved."""
try:
- self.run(['git', 'apply', '--cached']
- ).raw_input(patch_text).no_output()
+ r = self.run(['git', 'apply', '--cached']).raw_input(patch_text)
+ if quiet:
+ r = r.discard_stderr()
+ r.no_output()
except run.RunException:
raise MergeException('Patch does not apply cleanly')
def delete(self):