changeset 87:b543bbb9bf92

Fix directory-dependence of my 'exclude' pattern, which caused qcrefresh to misbehave if not running from the directory that contained all modified files (!)
author Steve Fink <sfink@mozilla.com>
date Fri, 22 Jul 2011 15:58:33 -0700
parents e87d428ad91f
children fd72c5cd0633
files crecord/__init__.py
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/crecord/__init__.py
+++ b/crecord/__init__.py
@@ -56,6 +56,10 @@
     usage.
     '''
 
+    # Note: if the record operation (or subsequent refresh) fails partway
+    # through, the top applied patch will be emptied and the working directory
+    # will contain all of its changes.
+
     try:
         mq = extensions.find('mq')
     except KeyError:
@@ -64,10 +68,10 @@
     def refreshmq(ui, repo, *pats, **opts):
         mq.refresh(ui, repo, *pats, **opts)
 
-    # If the record operation (or subsequent refresh), the top applied patch
-    # will be emptied and the working directory will contain all of its
-    # changes.
-    clearopts = { 'exclude': '*', 'message': '' }
+    # Cannot use the simple pattern '*' because it will resolve relative to the
+    # current working directory
+    clearopts = { 'exclude': ["re:."], 'message': "" }
+
     mq.refresh(ui, repo, **clearopts)
     dorecord(ui, repo, refreshmq, *pats, **opts)