Permalink
Browse files

Added translation for 'hg outgoing'

  • Loading branch information...
spookylukey committed Feb 19, 2011
1 parent 8e38927 commit 8cf53aea1457927a8a733057415df20e9e493c35
@@ -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")
@@ -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"
@@ -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])])
@@ -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):

0 comments on commit 8cf53ae

Please sign in to comment.