Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add latest revision date option to output of depend. #843

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions pyang/plugins/depend.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ def add_opts(self, optparser):
help="(sub)module to ignore in the" \
" prerequisites. This option can be" \
" given multiple times."),
optparse.make_option("--depend-include-revision",
dest="depend_include_revision",
action="store_true",
help="Include latest revision in" \
" prerequisites"),
]
g = optparser.add_option_group("Depend output specific options")
g.add_options(optlist)
Expand Down Expand Up @@ -81,6 +86,9 @@ def emit_depend(ctx, modules, fd):
filename = '%s%s' % (basename, ctx.opts.depend_extension)
fd.write(' %s' % filename)
else:
if ctx.opts.depend_include_revision:
m = ctx.get_module(i)
i = ' %s@%s' % (i, m.i_latest_revision)
if ctx.opts.depend_extension is None:
ext = ""
else:
Expand Down