# HG changeset patch # User Jeff Hammel # Date 1274809926 25200 # Node ID dedf4c4c2ba219a68a02e291f99ff08cd6288294 # Parent 67e06ca7c56e9914f6ce9e8e8620061a80b19711 add a function to list files (incomplete) diff -r 67e06ca7c56e -r dedf4c4c2ba2 hq/main.py --- a/hq/main.py Tue May 04 08:36:21 2010 -0700 +++ b/hq/main.py Tue May 25 10:52:06 2010 -0700 @@ -61,7 +61,17 @@ call(['hg', 'qpop', '--all']) call(['hg', 'pull'] + repo and [repo] or []) call(['hg', 'qpush', '--all']) - + + def files(self): + """ + list the files added by the top patch + """ + # TODO: should only list top-level directories, otherwise it's silly + _oldcwd = os.getcwd() + process = subprocess.Popen("hg qdiff | grep '^+++ ' | sed 's/+++ b\///'", stdout=subprocess.PIPE) + stdout, stderr = process.communicate() + return stdout + def main(args=sys.argv[1:]): parser = CommandParser(HQ)