Nadeem Vawda <nadeem.va...@gmail.com> added the comment: Thanks for taking this up; it's something that's been bothering me for a while now.
A couple of comments: - The mq_changed_files() function will break if the user has specified git-format diffs in their ~/.hgrc file. In this case, the diff command in the output will begin with "diff --git" instead of "diff -r". - What happens if a file has been deleted by the patch? The regular "hg status" command is set up to only return the added/modified files. You might want to check whether the file currently exists before adding it to the list of filenames to check. - Have you considered the possibility of there being multiple patches? In this case, I think it makes sense to check the files in every patch, not just the topmost. An alternative approach that solves all three of these problems is to check whether we have any patches applied (using "hg qapplied"), and if this is the case, then add "--rev qbase" to the "hg status" command line. This will list all files added/modified by patches as well as by uncommitted changes. - Using an mq command (e.g. qdiff or qapplied) will fail if the user does not have the mq extension enabled. In this case, mq_changed_files() should not allow Mercurial's error message to be printed. Ideally, it should distinguish between this and other errors by checking the subprocess's stderr, so that if a different error occurs, we can still print out the error message. - In changed_files(), I don't think it makes sense to create an empty list ("files = []") and then append to it immediately. It would be better to just initialize "files" directly from the list comprehension. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14053> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com