# HG changeset patch # User Patrick Mezard # Date 1211147373 -7200 # Node ID de83188043b2ac844f3a57c143d86f263c17f796 # Parent e9dfe4e3ee6f994df287b6bf4a1ab4cfea8acbfa# Parent 8d9d09d7c8b7901eec5792c22542ce3b3cc38b17 Merge with crew-stable diff -r e9dfe4e3ee6f -r de83188043b2 hgext/mq.py --- a/hgext/mq.py Sun May 18 23:31:54 2008 +0200 +++ b/hgext/mq.py Sun May 18 23:49:33 2008 +0200 @@ -126,6 +126,8 @@ self.series_guards.append(self.guard_re.findall(comment)) def check_guard(self, guard): + if not guard: + return _('guard cannot be an empty string') bad_chars = '# \t\r\n\f' first = guard[0] for c in '-+': diff -r e9dfe4e3ee6f -r de83188043b2 tests/test-mq-guards --- a/tests/test-mq-guards Sun May 18 23:31:54 2008 +0200 +++ b/tests/test-mq-guards Sun May 18 23:49:33 2008 +0200 @@ -44,6 +44,8 @@ hg qpush hg qpop +echo % test selection of an empty guard +hg qselect "" hg qselect a echo % should push a.patch hg qpush diff -r e9dfe4e3ee6f -r de83188043b2 tests/test-mq-guards.out --- a/tests/test-mq-guards.out Sun May 18 23:31:54 2008 +0200 +++ b/tests/test-mq-guards.out Sun May 18 23:49:33 2008 +0200 @@ -15,6 +15,8 @@ applying b.patch Now at: b.patch Patch queue now empty +% test selection of an empty guard +abort: guard cannot be an empty string number of unguarded, unapplied patches has changed from 2 to 3 % should push a.patch applying a.patch diff -r e9dfe4e3ee6f -r de83188043b2 tests/test-mq.out --- a/tests/test-mq.out Sun May 18 23:31:54 2008 +0200 +++ b/tests/test-mq.out Sun May 18 23:49:33 2008 +0200 @@ -28,7 +28,7 @@ qclone clone main and patch repository at same time qcommit commit changes in the queue repository qdelete remove patches from queue - qdiff diff of the current patch + qdiff diff of the current patch and subsequent modifications qfold fold the named patches into the current patch qgoto push or pop patches until named patch is at top of stack qguard set or print guards for a patch