Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vcstranslator_project/apps/translator/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def test_hg_to_git(self):
self.assert_translates(t, "record", "git add -p && git commit")
self.assert_translates(t, "log", "git log --all")
self.assert_translates(t, "", "git")
self.assert_translates(t, "outgoing", "git log origin..HEAD")

def test_git_to_hg(self):
t = Translator("git", "hg")
Expand Down
7 changes: 6 additions & 1 deletion vcstranslator_project/apps/translator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def translate_status(self, command):
return "git status"

def translate_log(self, command):
if command.outgoing:
return "git log origin..HEAD"
if command.files is not command.ALL or command.branches is not command.ALL:
return
return "git log --all"
Expand Down Expand Up @@ -163,6 +165,8 @@ def parse(self, command):
return Status()
elif parts == ["log"]:
return Log(branches=Log.ALL, files=Log.ALL)
elif parts == ["outgoing"]:
return Log(branches=Log.ALL, files=Log.ALL, outgoing=True)
elif parts[0] == "revert" and len(parts) == 2:
return Revert(files=[SomeFile(parts[1])])

Expand Down Expand Up @@ -360,9 +364,10 @@ def __init__(self, verbose):
self.verbose = verbose

class Log(Command):
def __init__(self, branches, files):
def __init__(self, branches, files, outgoing=False):
self.branches = branches
self.files = files
self.outgoing = outgoing

class Help(Command):
def __init__(self, useless=False):
Expand Down