tags:

views:

60

answers:

1

My question is very similar to this one.

I have the files under Mercurial version control and each file have a string:

<modified-time>some time</modified-time>

This line have created the an external tool, and the tool change this line periodically. I don't want to know about changes in this line and want to ignore the changes in this line when I doing 'diff', 'commit' and 'status' commands.

  1. So, if a file has only one change and the change is that line I need to skip this file in the output of 'hg status' command.
  2. If the file has another changes in the other lines I need to get this file in the output of 'hg status' command.

If I commit the file I need to commit all the changes.

+1  A: 

(UPDATE sorry to misread the question and mislead OP.)

If all your files are generated by the external tool, track the source files instead.

If not, and if you can modify the generator, make it use the date keyword as with the bundled keyword extension.

If not (OP's comment indicated so), you could use pre-* hooks to ignore the time change (when it's the only change). It'd be a pain, though, since you have to have a hook for every command that would see the file difference.

Or as OP's comment suggested, revert the file when it has only time change, either manually or automatically (on a timer or subscribe to file system notification).

Geoffrey Zheng
I see demas is happy w/ the answer, but I don't understand how using an extension that inserts dates is going to help him ignore changes to dates made by other "external" tools? What am I missing?
Ry4an
I guess (hope) OP has the luxury to change the "external tool", or has stopped using it to populate the date now he knows the kosher way.
Geoffrey Zheng
Sorry for accepting the answer. It was my mistake. I was mileaded. Regarding the external tool, I don't have a source code and can not change it behaviour.
demas
I think the only one way to solve my problem is to create another program (daemon) which will remove <modified-time> tag from files.
demas