[prev in list] [next in list] [prev in thread] [next in thread] 

List:       darcs-users
Subject:    Re: [darcs-users] Re: Onto which other patches does a patch depend?
From:       Erik_Bågfors <zindar () gmail ! com>
Date:       2005-01-04 12:48:23
Message-ID: 845b6e870501040448112ece47 () mail ! gmail ! com
[Download RAW message or body]

On Tue, 4 Jan 2005 01:33:39 +0100, Erik Schnetter <schnetter@aei.mpg.de> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Monday 03 January 2005 22:24, Mark Stosberg wrote:
> > On 2005-01-03, Erik Schnetter <schnetter@aei.mpg.de> wrote:
> > > I assume that I recorded some other patch later on that depends on
> > > this patch.  What does "depend" mean?
> >
> > I think it means "requires the existence of to make sense".
> >
> > > How do I find out onto which other patches this patch depends?
> >
> > I believe discovering this a feature currently missing from darcs.
> 
> I found "darcs send -o FILE" which produces a thingy called "context".
> This is basically what I was looking for.
> 
> In order to clean up my repository, i.e., in order to remove all traces
> of the unlucky patch-that-should-never-have-been, I resorted to editing
> this file manually, breaking it up into chunks, and then feeding it
> piecewise into "darcs apply".  That worked surprisingly well.  Is that
> documented somewhere?
> 
> For the record:
> 
> * The file has a checksum.  Editing the file invalidates the checksum,
> obviously.  You can just delete the checksum, and darcs doesn't bother
> any more.
> 
> * When you break up the file into two, then you need to add the patches
> of the first part to the context in the second part, in reverse order.
> 
> * Deleting hunks or whole patches is easy.  Modifying hunks is evil.
> Especially getting the line numbers correct is difficult, as earlier
> hunks influence later hunks in the same file.  Is there a "--fuzzy"
> option to "darcs apply"?
> 
> Is that what the "external merge tool" is for?  I kept the default
> setting of not allowing any conflicts.  Would I have been happier with
> such a merge tool?  Note that I don't want to resolve the conflict, I
> want to modify the patch so that the conflict goes away.
> 
> (Yes, everything was in a local repository; no changes had left my
> repository.  Had some of the changes left my repository, then I would
> not have needed to delete all traces of the unlucky patch.)
> 
> - -erik
> 
> PS: Maybe much of my trouble could have been avoided by not queueing a
> week's worth of patches in a single repository, but by using different
> local repositories for different set of patches.  I would have had
> trouble merging them, but the patches would not have depended on each
> other, which seems to have been the root of the problem.

They should only depend on eachother if they have any reason to, like
they change the same code for example.

This if one of the problems I'm having with darcs, it's hard to know
when a patch depends on another.

This is how I've dealt with it.

Say I have one patch named "backup" and one named "depend on backup",
where "depend on backup" obviously depends on the backup-patch. They
modified the same line.

Now say I don't know that "depend on backup" really depends on the
backup.  I want to remove "backup".

This is what would happen when unpulling.

: [bagfors@zyrgelkwytng]$ ; darcs unpull


Tue Jan  4 13:34:23 CET 2005  e@e.se
  * depend on backup
Shall I unrecord this patch? [yNvq?] n

Tue Jan  4 13:34:17 CET 2005  e@e.se
  * testtest
Shall I unrecord this patch? [yNvq?] n

Skipping depended-upon patch:
Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup


So, now I know that "backup" depends on either "depend on backup" or
"testtest".  In this case it's quite simple to test which one but say
I've got 15 patches there, or 100.. that would be harder..

what I've done then is "get" to the "backup" patch.

darcs get --to-patch '^backup$' repo

then if you in the new repo run unpull you'll see

: [bagfors@zyrgelkwytng]$ ; darcs unpull

Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup
Shall I unpull this patch? [yNvq?]

ok... so that works, then I pull patch after patch from the main repo
until that stops working.

: [bagfors@zyrgelkwytng]$ ; echo yd | darcs pull
: [bagfors@zyrgelkwytng]$ ; darcs unpull

Tue Jan  4 13:34:17 CET 2005  e@e.se
  * testtest
Shall I unpull this patch? [yNvq?] n

Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup
Shall I unpull this patch? [yNvq?] n

so, it still works.

: [bagfors@zyrgelkwytng]$ ; echo yd | darcs pull

: [bagfors@zyrgelkwytng]$ ; darcs unpull

Tue Jan  4 13:34:23 CET 2005  e@e.se
  * depend on backup
Shall I unpull this patch? [yNvq?] n

Tue Jan  4 13:34:17 CET 2005  e@e.se
  * testtest
Shall I unpull this patch? [yNvq?] n

Skipping depended-upon patch:
Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup

it doesn't work anymore, so, "depend on backup" is the patch I have to
unpull to be able to unpull "backup"

It's really not intuitive.

What I'd like to see is either the following


: [bagfors@zyrgelkwytng]$ ; darcs unpull

Tue Jan  4 13:34:23 CET 2005  e@e.se
  * depend on backup
Shall I unpull this patch? [yNvq?] n

Tue Jan  4 13:34:17 CET 2005  e@e.se
  * testtest
Shall I unpull this patch? [yNvq?] n

Skipping depended-upon patch: depends on "depend on backup"
Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup



Or the same thing as with "darcs pull" where I can pull a patch that
depends on another patch and both of them get's pulled.

: [bagfors@zyrgelkwytng]$ ; darcs pull -v
Pulling from "/home/bagfors/tmp/a/a"...
We have the following new (to them) patches:
They have the following patches to pull:
Tue Jan  4 13:34:23 CET 2005  e@e.se
  * depend on backup
Tue Jan  4 13:34:17 CET 2005  e@e.se
  * testtest
Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup

Tue Jan  4 13:27:20 CET 2005  e@e.se
  * backup
Shall I pull this patch? (1/3) [ynWvxqadjk], or ? for help: j

Tue Jan  4 13:34:17 CET 2005  e@e.se
  * testtest
Shall I pull this patch? (2/3) [ynWvxqadjk], or ? for help: j

Tue Jan  4 13:34:23 CET 2005  e@e.se
  * depend on backup
Shall I pull this patch? (3/3) [ynWvxqadjk], or ? for help: y
Getting and merging the following patches:
[backup
e@e.se**20050104122720]
[depend on backup
e@e.se**20050104123423]
diffing dir...
Applying patches to the local directories...
diffing dir...
Finished pulling.



Regards,
Erik


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic