Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 4530:0ac7fee4f024
Make sure the changelog mentions files whose flags changed
These changes don't actually need a new filelog entry (see next patch),
but if we don't mention the files in the changelog, it becomes much
harder to find all changesets that touch a file (not even a
"hg log --removed file" will work).
author | Alexis S. L. Carvalho <alexis@cecm.usp.br> |
---|---|
date | Sat, 09 Jun 2007 01:04:28 -0300 |
parents | 78b6add1f966 |
children | b51a8138292a |
line wrap: on
line diff
--- a/mercurial/localrepo.py Fri Jun 08 23:49:12 2007 -0300 +++ b/mercurial/localrepo.py Sat Jun 09 01:04:28 2007 -0300 @@ -784,7 +784,16 @@ self.ui.note(f + "\n") try: new[f] = self.filecommit(f, m1, m2, linkrev, tr, changed) - m1.set(f, is_exec(f), is_link(f)) + new_exec = is_exec(f) + new_link = is_link(f) + if not changed or changed[-1] != f: + # mention the file in the changelog if some flag changed, + # even if there was no content change. + old_exec = m1.execf(f) + old_link = m1.linkf(f) + if old_exec != new_exec or old_link != new_link: + changed.append(f) + m1.set(f, new_exec, new_link) except (OSError, IOError): if use_dirstate: self.ui.warn(_("trouble committing %s!\n") % f)