Skip to content

Commit

Permalink
Don't require file argument in Plan.save()
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnks committed Dec 29, 2023
1 parent 176dc33 commit c231186
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions devel_doc/git-cherry-plan
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ class Plan(object):

count += 1

def save(self, file):
def save(self, file=None):
"""Dump the plan to a file on disk."""
if file is None:
file = self.file
with open(file, 'w') as f:
f.write(str(self))

Expand Down Expand Up @@ -454,15 +456,15 @@ def pull(plan, args):
return 1
plan.load(args.file)
plan.pull(True)
plan.save(args.file)
plan.save()
return 0

def cut(plan, args):
if ensure_exists(args.file):
return 1
plan.load(args.file)
plan.cut(args.where, args.delete)
plan.save(args.file)
plan.save()
return 0

def dump(plan, args):
Expand Down Expand Up @@ -519,7 +521,7 @@ def update(plan, args):
return 1
plan.load(args.file)
plan.update(True)
plan.save(args.file)
plan.save()
return 0

def status(plan, args):
Expand Down

0 comments on commit c231186

Please sign in to comment.