Ejemplo n.º 1
0
Archivo: perf.py Proyecto: leszfb/eden
 def d():
     # acceptremote is True because we don't want prompts in the middle of
     # our benchmark
     merge.calculateupdates(
         repo,
         wctx,
         rctx,
         [ancestor],
         False,
         False,
         acceptremote=True,
         followcopies=True,
     )
Ejemplo n.º 2
0
Archivo: hg.py Proyecto: jsoref/eden
    def _calculatemergedfiles(self, source, p1ctx, p2ctx):
        """Calculates the files from p2 that we need to pull in when merging p1
        and p2, given that the merge is coming from the given source.

        This prevents us from losing files that only exist in the target p2 and
        that don't come from the source repo (like if you're merging multiple
        repositories together).
        """
        anc = [p1ctx.ancestor(p2ctx)]
        # Calculate what files are coming from p2
        actions, diverge, rename = mergemod.calculateupdates(
            self.repo,
            p1ctx,
            p2ctx,
            anc,
            True,  # branchmerge
            True,  # force
            False,  # acceptremote
            False,  # followcopies
        )

        for file, (action, info, msg) in actions.iteritems():
            if source.targetfilebelongstosource(file):
                # If the file belongs to the source repo, ignore the p2
                # since it will be covered by the existing fileset.
                continue

            # If the file requires actual merging, abort. We don't have enough
            # context to resolve merges correctly.
            if action in ["m", "dm", "cd", "dc"]:
                raise error.Abort(
                    _(
                        "unable to convert merge commit "
                        "since target parents do not merge cleanly (file "
                        "%s, parents %s and %s)"
                    )
                    % (file, p1ctx, p2ctx)
                )
            elif action == "k":
                # 'keep' means nothing changed from p1
                continue
            else:
                # Any other change means we want to take the p2 version
                yield file