# HG changeset patch # User Alexis S. L. Carvalho # Date 2007-06-09 04:04:28 # Node ID 0ac7fee4f02462d1a29350856e97d82c5d13539c # Parent 860478527568e4aae0b46f271e9d556e387b44d1 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). diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -784,7 +784,16 @@ class localrepository(repo.repository): 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) diff --git a/tests/test-flags b/tests/test-flags --- a/tests/test-flags +++ b/tests/test-flags @@ -19,6 +19,8 @@ hg pull ../test1 hg co chmod +x a hg ci -m "chmod +x a" -d "1000000 0" +echo % the changelog should mention file a: +hg tip --template '#files#\n' cd ../test1 echo 123 >>a diff --git a/tests/test-flags.out b/tests/test-flags.out --- a/tests/test-flags.out +++ b/tests/test-flags.out @@ -7,6 +7,8 @@ adding file changes added 1 changesets with 2 changes to 2 files (run 'hg update' to get a working copy) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved +% the changelog should mention file a: +a pulling from ../test2 searching for changes adding changesets