def _oldworkingcopyparent(repo, subset, x): """``oldworkingcopyparent([index])`` previous working copy parent 'index' is how many undoable commands you want to look back. See 'hg undo'. """ args = revset.getargsdict(x, "oldoworkingcopyrevset", "reverseindex") reverseindex = revsetlang.getinteger( args.get("reverseindex"), _("index must be a positive interger"), 1) revs = _getoldworkingcopyparent(repo, reverseindex) return subset & smartset.baseset(revs)
def _olddraft(repo, subset, x): """``olddraft([index])`` previous draft commits 'index' is how many undoable commands you want to look back an undoable command is one that changed draft heads, bookmarks and or working copy parent. Note that olddraft uses an absolute index and so olddraft(1) represents the state after an hg undo -a and not an hg undo. Note: this revset may include hidden commits """ args = revset.getargsdict(x, "olddraftrevset", "reverseindex") reverseindex = revsetlang.getinteger(args.get("reverseindex"), _("index must be a positive integer"), 1) revs = _getolddrafts(repo, reverseindex) return subset & smartset.baseset(revs)