changeset 6340:949e607ac544

mq: warn when applying a patch to somewhere other than tip
author Matt Mackall <mpm@selenic.com>
date Fri, 21 Mar 2008 15:44:11 -0500
parents ed9b07a97587
children 63bdfcc3eaaf
files hgext/mq.py tests/test-mq.out
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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