diff hgext/patchbomb.py @ 21055:dbff8c119cf6

patchbomb: warn when emailing a dirty working directory parent
author Mads Kiilerich <madski@unity3d.com>
date Mon, 07 Apr 2014 23:10:20 +0200
parents 49f2d5644f04
children 697fba94dec9
line wrap: on
line diff
--- a/hgext/patchbomb.py	Wed Mar 19 00:19:54 2014 +0100
+++ b/hgext/patchbomb.py	Mon Apr 07 23:10:20 2014 +0200
@@ -291,7 +291,11 @@
         return [str(r) for r in revs]
 
     def getpatches(revs):
+        prev = repo['.'].rev()
         for r in scmutil.revrange(repo, revs):
+            if r == prev and (repo[None].files() or repo[None].deleted()):
+                ui.warn(_('warning: working directory has '
+                          'uncommitted changes\n'))
             output = cStringIO.StringIO()
             cmdutil.export(repo, [r], fp=output,
                          opts=patch.diffopts(ui, opts))