[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] file-revert
From: |
Tom Lord |
Subject: |
Re: [Gnu-arch-users] file-revert |
Date: |
Wed, 17 Sep 2003 13:37:36 -0700 (PDT) |
> From: Dustin Sallings <address@hidden>
> I've implemented file-revert in my tree, except I do not believe the
> behavior is *exactly* right. I'm basically doing this:
> safe_unlink(mod_loc);
> copy_file(orig_path, mod_loc);
> That gets me the right file in the right place, but the file shows up
> in what-changed (presumably because the inode changed). Is there a
> more correct way to do this?
Really?! If so, that'd be a bug.
The change in inode signature should force what-changed to actually
`diff' the file, but if the comparison says that it's unchanged, then
it's unchanged.
What does `what-changed --diffs' say about that file after reversion?
Also: well, I don't have the rest of your code to look at, but --
*) are you sure you don't mean copy_file_or_symlink
(which is likely unrelated to the problem you're seeing)
*) are you sure that mod_loc is a correct relative path from from the
cwd of the process (which _might_ be related to the problem you're
seeing -- but probably not if "by eye" you think the file is
correctly reverted)
*) (unrelated): I don't know about that unlink. How about a rename
to a ",," file, instead?
(Thanks for working on that command. I'm sure that others will
appreciate it. Something silly like cat `tla file-find ....` > file
would do the same thing but that is certainly a little too
inconvenient for what seems to be an operation that people often
want.)
-t