Mercurial > hg > hq
changeset 2:dedf4c4c2ba2
add a function to list files (incomplete)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 25 May 2010 10:52:06 -0700 |
parents | 67e06ca7c56e |
children | 8bc27dbf0214 |
files | hq/main.py |
diffstat | 1 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)