165
165
self.outf.write("%s\n" % sha1)
170
class cmd_git_refs(Command):
171
"""Output all of the virtual refs for a repository.
177
takes_options = [Option('directory',
179
help='Location of repository.', type=unicode)]
182
def run(self, directory="."):
183
from bzrlib.bzrdir import (
186
from bzrlib.plugins.git.refs import (
189
from bzrlib.plugins.git.object_store import (
192
bzrdir, _ = BzrDir.open_containing(directory)
193
repo = bzrdir.find_repository()
196
object_store = get_object_store(repo)
197
refs = BazaarRefsContainer(bzrdir, object_store)
198
for k, v in refs.as_dict().iteritems():
199
self.outf.write("%s -> %s\n" % (k, v))
204
class cmd_git_apply(Command):
205
"""Apply a series of git-am style patches.
207
This command will in the future probably be integrated into
211
takes_args = ["patches*"]
213
def _apply_patch(self, wt, f):
214
from dulwich.patch import git_am_patch_split
215
(c, diff, version) = git_am_patch_split(f)
216
# FIXME: Process diff
217
wt.commit(committer=c.committer,
220
def run(self, patches_list=None):
221
from bzrlib.workingtree import WorkingTree
222
if patches_list is None:
225
tree, _ = WorkingTree.open_containing(".")
228
for patch in patches_list:
231
self._apply_patch(tree, f)