- return name in name2patch or crt_series.patch_exists(name)
-
- for victim in victims:
- patchname = make_patch_name(victim.get_log(), name_taken)
- patch2name[victim] = patchname
- name2patch[patchname] = victim
-
- victims.reverse()
- for victim in victims:
- out.info('Creating patch "%s" from commit %s'
- % (patch2name[victim], victim))
- aname, amail, adate = name_email_date(victim.get_author())
- cname, cmail, cdate = name_email_date(victim.get_committer())
- crt_series.new_patch(
- patch2name[victim],
- can_edit = False, before_existing = False, commit = False,
- top = victim.get_id_hash(), bottom = victim.get_parent(),
- message = victim.get_log(),
- author_name = aname, author_email = amail, author_date = adate,
- committer_name = cname, committer_email = cmail)
+ return name in names
+ if applied and patchify:
+ out.start('Creating %d new patch%s'
+ % (len(patchify), ['es', ''][len(patchify) == 1]))
+ for p in patchify:
+ name = make_patch_name(p.commit.get_log(), name_taken)
+ out.info('Creating patch %s from commit %s' % (name, p.id))
+ aname, amail, adate = name_email_date(p.commit.get_author())
+ cname, cmail, cdate = name_email_date(p.commit.get_committer())
+ parent, = p.parents
+ crt_series.new_patch(
+ name, can_edit = False, commit = False,
+ top = p.id, bottom = parent.id, message = p.commit.get_log(),
+ author_name = aname, author_email = amail, author_date = adate,
+ committer_name = cname, committer_email = cmail)
+ p.patch = name
+ applied.append(p)
+ names.add(name)
+ out.done()
+
+ # Write the applied/unapplied files.
+ out.start('Checking patch appliedness')
+ applied_name_set = set(p.patch for p in applied)
+ unapplied_names = []
+ for name in orig_applied:
+ if not name in applied_name_set:
+ out.info('%s is now unapplied' % name)
+ unapplied_names.append(name)
+ for name in orig_unapplied:
+ if name in applied_name_set:
+ out.info('%s is now applied' % name)
+ else:
+ unapplied_names.append(name)
+ crt_series.set_applied(p.patch for p in applied)
+ crt_series.set_unapplied(unapplied_names)
+ out.done()