[Unison-hackers] patches: nodeletion, ignorefile

Damien Pous Damien.Pous at ens-lyon.fr
Fri Nov 4 09:22:14 EST 2005


Here are two patches: 

* nodeletion.diff: adds a "nodeletion" switch, that prevents unison from
propagating deletion automatically:
   1) a conflict is issued when a path has been deleted in one replica,
and left unmodified in the other one
   2) in batch mode, deletions are skipped (with a warning) 

point 2 is indeed a safety assertion, since all deletions should be
handled as conflicts and thus be skipped in batch mode

* ignorefile.diff: adds a "ignorefile" option, that allows one to
specify a filename to search for additional ignore directives, in a per
directory basis (like .cvsignore files):
suppose you work with "ignorefile = .unisonignore", you can ignore
all .eps files of a directory by putting a .unisonignore file in this
directory, containing the line '*.eps'

I did it by redefining the function Globals.shouldIgnore
whenever an ignore file is read, its content (converted as a regex) is
cached in an hashtable.

I had to add an argument "fspath" to this function, since it had to
manipulate `real' paths. I could add this parameter to every call to
this function, except for the calls in Ui{text,gtk...} when an ignore
directive is added by the user and that the list on reconItems has to be
filtered. This is not problematic since in this case, shouldIgnore is
called with paths that have already been checked against ignore files.

I have not yet widely tested the latter patch...

Damien

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ignorefile.diff
Type: text/x-patch
Size: 7747 bytes
Desc: not available
Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20051104/89288522/ignorefile.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nodeletion.diff
Type: text/x-patch
Size: 4436 bytes
Desc: not available
Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20051104/89288522/nodeletion.bin


More information about the Unison-hackers mailing list