mq: warn when applying a patch to somewhere other than tip
authorMatt Mackall <mpm@selenic.com>
Fri, 21 Mar 2008 15:44:11 -0500
changeset 6340 949e607ac544
parent 6339 ed9b07a97587
child 6341 63bdfcc3eaaf
mq: warn when applying a patch to somewhere other than tip
hgext/mq.py
tests/test-mq.out
--- a/hgext/mq.py	Fri Mar 21 21:56:55 2008 +0100
+++ b/hgext/mq.py	Fri Mar 21 15:44:11 2008 -0500
@@ -766,6 +766,9 @@
     def push(self, repo, patch=None, force=False, list=False,
              mergeq=None):
         wlock = repo.wlock()
+        if repo.dirstate.parents()[0] != repo.lookup("tip"):
+            self.ui.status(_("(working directory not at tip)\n"))
+
         try:
             patch = self.lookup(patch)
             # Suppose our series file is: A B C and the current 'top'
--- a/tests/test-mq.out	Fri Mar 21 21:56:55 2008 +0100
+++ b/tests/test-mq.out	Fri Mar 21 15:44:11 2008 -0500
@@ -332,6 +332,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 Patch queue now empty
+(working directory not at tip)
 applying bar
 Now at: bar
 diff --git a/bar b/bar
@@ -365,6 +366,7 @@
 adding file changes
 added 1 changesets with 1 changes to 1 files
 Patch queue now empty
+(working directory not at tip)
 applying bar
 Now at: bar
 diff --git a/foo b/bleh