Skip to content

Commit

Permalink
Add a --all option to s_pull
Browse files Browse the repository at this point in the history
  • Loading branch information
agateau committed Apr 29, 2016
1 parent 748e9cf commit 42c37ce
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion yokadi/ycli/synccmd.py
Expand Up @@ -2,6 +2,7 @@
from cmd import Cmd

from yokadi.core import basepaths
from yokadi.core.yokadioptionparser import YokadiOptionParser
from yokadi.sync.conflictingobject import BothModifiedConflictingObject
from yokadi.sync.pullui import PullUi
from yokadi.sync.vcsimplerrors import VcsImplError, NotFastForwardError
Expand Down Expand Up @@ -121,9 +122,22 @@ def do_s_dump(self, line):
print('Database dumped in {}'.format(self.dumpDir))

def do_s_pull(self, line):
parser = self.parser_s_pull()
args = parser.parse_args(line)
pullUi = TextPullUi()
self.syncManager.pull(pullUi=pullUi)
self.syncManager.importSinceLastSync(pullUi=pullUi)
if args.all:
self.syncManager.importAll(pullUi=pullUi)
else:
self.syncManager.importSinceLastSync(pullUi=pullUi)

def parser_s_pull(self):
parser = YokadiOptionParser()
parser.usage = "s_pull [options]"
parser.description = "Pull changes from a remote repository"
parser.add_argument("--all", dest="all", default=False, action="store_true",
help="Import all changes, regardless of the current synchronization status")
return parser

def do_s_push(self, line):
try:
Expand Down

0 comments on commit 42c37ce

Please sign in to comment.