Message153723
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. |
|
Date |
User |
Action |
Args |
2012-02-19 20:13:15 | nadeem.vawda | set | recipients:
+ nadeem.vawda, ezio.melotti, eric.araujo, francismb |
2012-02-19 20:13:15 | nadeem.vawda | set | messageid: <1329682395.55.0.536127757839.issue14053@psf.upfronthosting.co.za> |
2012-02-19 20:13:14 | nadeem.vawda | link | issue14053 messages |
2012-02-19 20:13:14 | nadeem.vawda | create | |
|