Skip to content

Commit

Permalink
git log -> svn log
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jan 22, 2011
1 parent 1393e90 commit bbf4864
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions vcstranslator_project/apps/translator/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def test_git_to_svn(self):
self.assert_translates(t, "clone", "svn checkout")
self.assert_translates(t, "status", "svn status")
self.assert_translates(t, "diff", "svn diff")
self.assert_translates(t, "log", "svn log")
self.assert_cant_handle(t, "push")

def test_hg_to_git(self):
Expand Down
8 changes: 8 additions & 0 deletions vcstranslator_project/apps/translator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def parse(self, command):
return Diff()
elif parts == ["commit", "-a"]:
return Commit(files=Commit.ALL, push=False)
elif parts == ["log"]:
return Log(branches=Log.CURRENT, files=Log.ALL)
elif parts[0] == "remote":
parts = parts[1:]
if parts == ["-v"]:
Expand Down Expand Up @@ -212,6 +214,11 @@ def translate_push(self, command):
def translate_diff(self, command):
return "svn diff"

def translate_log(self, command):
if command.branches is not command.CURRENT or command.files is not command.ALL:
return
return "svn log"

class Translator(object):
vcs = SortedDict([
("bzr", BzrTranslator),
Expand Down Expand Up @@ -280,6 +287,7 @@ def __init__(self, path):

class Command(object):
ALL = object()
CURRENT = object()

class Init(Command):
pass
Expand Down

0 comments on commit bbf4864

Please sign in to comment.