Deleted Added
sdiff udiff text old ( 11922:0b284e4322fc ) new ( 12256:a100657644ee )
full compact
1#!/usr/bin/env python2
2#
3# Copyright (c) 2017 ARM Limited
4# All rights reserved
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 91 unchanged lines hidden (view full) ---

100 return None
101
102 assert len(cids) == 1
103 return cids[0]
104
105 def __str__(self):
106 return "%s: %s" % (self.rev[0:8], self.log[0])
107
108def list_revs(upstream, branch):
109 """Get a generator that lists git revisions that exist in 'branch' but
110 not in 'upstream'.
111
112 Returns: Generator of Commit objects
113
114 """
115
116 changes = subprocess.check_output(
117 [ "git", "rev-list", "%s..%s" % (upstream, branch) ])
118
119 if changes == "":
120 return
121
122 for rev in changes.rstrip("\n").split("\n"):
123 assert rev != ""
124 yield Commit(rev)
125
126def list_changes(upstream, feature):

--- 33 unchanged lines hidden (view full) ---

160 "Default: %(default)s")
161 parser.add_argument("--feature", "-f", type=str, default="HEAD",
162 help="Feature branch for comparison. " \
163 "Default: %(default)s")
164 parser.add_argument("--show-unknown", action="store_true",
165 help="Print changes without Change-Id tags")
166 parser.add_argument("--show-common", action="store_true",
167 help="Print common changes")
168
169 args = parser.parse_args()
170
171 incoming, outgoing, common, upstream_unknown, feature_unknown = \
172 list_changes(args.upstream, args.feature)
173
174 if incoming:
175 print "Incoming changes:"

--- 19 unchanged lines hidden (view full) ---

195 print rev
196 print
197
198 if args.show_unknown and feature_unknown:
199 print "Outgoing changes without change IDs:"
200 for rev in feature_unknown:
201 print rev
202
203
204
205if __name__ == "__main__":
206 _main()