def push_tree(self, pn): """Push the named patch without updating its tree.""" orig_cd = self.patches[pn].data cd = orig_cd.set_committer(None).set_parent(self.top) s = '' if any(getattr(cd, a) != getattr(orig_cd, a) for a in ['parent', 'tree', 'author', 'message']): self.patches[pn] = self.__stack.repository.commit(cd) else: s = ' (unmodified)' if cd.is_nochange(): s = ' (empty)' out.info('Pushed %s%s' % (pn, s)) if pn in self.hidden: x = self.hidden else: x = self.unapplied del x[x.index(pn)] self.applied.append(pn)
try: interactive = (allow_interactive and config.get('stgit.autoimerge') == 'yes') iw.merge(base, ours, theirs, interactive = interactive) tree = iw.index.write_tree() self.__current_tree = tree s = 'modified' except git.MergeConflictException, e: tree = ours merge_conflict = True self.__conflicts = e.conflicts s = 'conflict' except git.MergeException, e: self.__halt(str(e)) cd = cd.set_tree(tree) if any(getattr(cd, a) != getattr(orig_cd, a) for a in ['parent', 'tree', 'author', 'message']): comm = self.__stack.repository.commit(cd) if merge_conflict: # When we produce a conflict, we'll run the update() # function defined below _after_ having done the # checkout in run(). To make sure that we check out # the real stack top (as it will look after update() # has been run), set it hard here. self.head = comm else: comm = None s = 'unmodified' if already_merged: s = 'merged' elif not merge_conflict and cd.is_nochange(): s = 'empty'