Anonymous committed 6c9c55a

repomodel: allow complete patch reordering

Using drag and drop, it was previously impossible to drop a patch at the bottom
most position (i.e. dropping it onto the "working directory", making it the
first patch to apply next). This is now possible.

Comments (0)

Files changed (1)


 from mercurial import util, error
 from mercurial.util import propertycache
+from mercurial.context import workingctx
 from tortoisehg.util import hglib
 from tortoisehg.hgqt.graph import Graph
         dragflags = Qt.ItemFlags(0)
         if ctx.thgmqunappliedpatch():
             dragflags = Qt.ItemIsDragEnabled | Qt.ItemIsDropEnabled
+        if isinstance(ctx, workingctx):
+            dragflags |= Qt.ItemIsDropEnabled
         if not self.revset:
             return Qt.ItemIsSelectable | Qt.ItemIsEnabled | dragflags
         if ctx.rev() not in self.revset: