gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Keeping original file contents in an update


From: John A Meinel
Subject: Re: [Gnu-arch-users] Keeping original file contents in an update
Date: Thu, 05 May 2005 11:24:32 -0500
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Yaron Minsky wrote:

A recurrent problem I've had with arch is that by default, after a
conflict, update leaves a .rej file, which tells you what patches
didn't apply, and an .orig file, which tells you what the file looked
like before the attempt to apply your changes.  But what it doesn't
keep is a version of your files before the update.

To see why this is a problem, consider the case where you have a file
foo to which you've made extensive changes.  You do an update, to
discover that someone has made incompatible changes to the same file.
You're left with a huge .rej file, and no clean way of getting back
your original file.  (the only way to do that, I think, is to apply
the ,,undo patch.  But you can't do it on a file-by-file basis, and
you can't do it at all once you've made other modifications to deal
with the other rej's.)  So, is there a good solution to this problem?
 To me, this seems pretty serious, since it can involve loosing data.

(another solution would be to use replay.  But I prefer the semantics
of update and would rather avoid using replay)

Yaron


I think tla is going to support per-file undo (baz already does with
"baz undo -- file1 file2 ..."). Which might help you here.

Also, you can use "tla library-file"
$ tla library-file -H
find a file in a revision library
usage: tla library-file [options] file revision

 -h, --help     Display a help message and exit.
 -H             Display a verbose help message and exit.
 -V, --version  Display a release identifier string
                and exit.
 -A, --archive  Override `my-default-archive'
 --id           interpret FILE as an inventory id
 --this         interpret FILE as a file within a project tree

Find FILE in REVISION in your revision library and print
its path. If the revision or file is not present, print
an error message and exit with non-0 status.

This will let you get the pristine version of your file. Something like:

cp `tla library-file $file $revision` ,$file

Will put a copy of the file as ",$file" so that you have it for reference.

You can use whatever naming scheme you like. And if you want to
completely reject all changes, you can do:

cp `tla library-file $file $revision` .

Which should replace the current copy with the original copy.

This may only work with revision libraries, and not pristine trees, but
we should have *something* that works with both so that people don't
have to worry about which library format they are using.

John
=:->

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]