#!/usr/bin/perl # EmmQueue - Easy Mnemonics for Mercurial Queues $_ = shift @ARGV; $args = join ' ', @ARGV; if (!$_ || /^help$/i) { print < length $_); return $string =~ /^$_/; } if (match('create')) { if ($args) { print `hg qnew -f $args`; } else { print "mq create PATCHNAME -- missing PATCHNAME\n"; } exit; } if (match('save')) { $args = 'backup' if (!$args); print `hg qrefresh`; print `hg qcommit -m $args`; exit; } if (match('diff')) { print `hg qdiff $args`; exit; } if (match('ldiff') || match('new')) { print `hg diff $args`; exit; } if (match('lstatus') || match('loose')) { print `hg status $args`; exit; } if (match('status')) { print `hg status --rev qparent $args`; exit; } if (match('log')) { print `hg log -r qbase:qtip $args`; exit; } if (match('list')) { print `hg qseries $args`; exit; } if (match('alist')) { print `hg qapplied $args`; exit; } if (match('ulist')) { print `hg qunapplied $args`; exit; } if (match('apply')) { print `hg qpush $args`; exit; } if (match('unapply')) { print `hg qpop $args`; exit; } if (match('current')) { print `hg qtop -s $args`; exit; } if (match('update')) { $_ = `hg qpop -a 2>&1`; print; print `hg pull -u` if (/queue now empty/ || /no patches applied/); exit; } if (match('finish')) { $args = 'qbase' if (!$args); print `hg qfinish $args`; exit; } if (match('absorb')) { print `hg qfold $args`; exit; } if (match('message') || match('msg')) { exec 'hg qrefresh -e'; exit; } if (match('init')) { print `hg qinit -c`; exit; } print "Unknown command. Type mq help for more info.\n";