This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nadeem.vawda
Recipients eric.araujo, ezio.melotti, francismb, nadeem.vawda
Date 2012-02-19.20:13:14
SpamBayes Score 5.4450393e-08
Marked as misclassified No
Message-id <1329682395.55.0.536127757839.issue14053@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-02-19 20:13:15nadeem.vawdasetrecipients: + nadeem.vawda, ezio.melotti, eric.araujo, francismb
2012-02-19 20:13:15nadeem.vawdasetmessageid: <1329682395.55.0.536127757839.issue14053@psf.upfronthosting.co.za>
2012-02-19 20:13:14nadeem.vawdalinkissue14053 messages
2012-02-19 20:13:14nadeem.vawdacreate