Patchwork [3,of,4] histedit: add abortdirty function

login
register
mail settings
Submitter Mateusz Kwapich
Date Nov. 13, 2015, 1:45 a.m.
Message ID <0f16f4e0ea312ecffa03.1447379158@mitrandir-mbp1.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/11390/
State Superseded
Commit 383f10b67fd64cc85ffc32a3f2982d7f467b7d26
Delegated to: Augie Fackler
Headers show

Comments

Mateusz Kwapich - Nov. 13, 2015, 1:45 a.m.
# HG changeset patch
# User Mateusz Kwapich <mitrandir@fb.com>
# Date 1447373615 28800
#      Thu Nov 12 16:13:35 2015 -0800
# Node ID 0f16f4e0ea312ecffa03128e55ac65dd38e7909c
# Parent  445d32ea992d69bd4f65d3343d3656985d22a8b0
histedit: add abortdirty function

Small helper function for aborting histedit when left with dirty working
directory.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -521,6 +521,12 @@ 
                          editor=editor)
     return repo.commitctx(new)
 
+def abortdirty():
+    raise util.Abort(_('working copy has pending changes'),
+        hint=_('amend, commit, or revert them and run histedit '
+            '--continue, or abort with histedit --abort'))
+
+
 class pick(histeditaction):
     def run(self):
         rulectx = self.repo[self.node]