darcs

Issue 328 amend removes dependencies selected with --ask-deps

Title amend removes dependencies selected with --ask-deps
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, thorkilnaur, tommy, trentbuck
Assigned To
Topics

Created on 2006-11-01.16:31:14 by trentbuck, last changed 2009-08-27.13:49:21 by admin.

Messages
msg1163 (view) Author: twb Date: 2006-11-01.16:31:04
I think if you amend a patch with explicitly selected deps, the
explicit deps are deleted.

If this interests anyone, I'll take the time to produce a minimal
example.
-- 
Trent Buck, Student Errant
msg1166 (view) Author: tommy Date: 2006-11-01.20:56:54
On Wed, Nov 01, 2006 at 04:31:15PM +0000, Trent Buck wrote:
> I think if you amend a patch with explicitly selected deps, the
> explicit deps are deleted.

Some thoughts on this issue (for those who'll try to fix it).
When a patch is amended, the implicit dependencies can change.
When darcs asks for explicit (extra) dependencies the first
time, it omits already implicit dependencies. So the "setup" for
explicit dependencies can change when a patch is amended. If a
previous explicit dependency becomes implicit, should the
explicit notion of it then be removed? I think not, because a
future amend can causes the now implicit (former explicit)
dependency to disappear totally. And there is, as far as I know,
no problem for darcs if a dependency exists in more than one
way. A more troublesome case is if the user intended to add an
explicit dependency, but couldn't because it was already
implicit, and that implicit dependency disappears after an
amend-record.

The simplest solutions seems to be just copying the old explicit
dependencies to the new patch, unless --ask-deps is used (this
option needs to be added too, maybe as a separate issue), in
which case the ask-deps dialogue should be rerun from scratsh, I
think.

> If this interests anyone, I'll take the time to produce a minimal
> example.

If you could write it as a test case script that fails until
darcs is properly fixed, that would be great.
msg1168 (view) Author: twb Date: 2006-11-02.03:03:04
On Wed, Nov 01, 2006 at 08:57:00PM +0000, Tommy Pettersson wrote:
> 
> Tommy Pettersson <ptp@lysator.liu.se> added the comment:
> 
> On Wed, Nov 01, 2006 at 04:31:15PM +0000, Trent Buck wrote:
> > I think if you amend a patch with explicitly selected deps, the
> > explicit deps are deleted.

Here is a transcript demonstrating the issue:

    $ darcs init
    $ echo foo >foo
    $ echo bar >bar
    $ darcs add foo bar
    $ darcs rec -am foo foo
    Recording changes in "foo":

    Finished recording patch 'foo'
    $ echo y | darcs rec -am bar --ask-deps bar
    Recording changes in "bar":

    Thu Nov  2 13:37:43 EST 2006  Trent Buck <trentbuck@gmail.com>
      * foo
    Shall I depend on this patch? (1/?)  [ynWvpxqadjkc], or ? for help: 
    Finished recording patch 'bar'
    $ darcs-deps 2>/dev/null
    digraph deps {
    	rankdir=LR;
    	node [ shape=box ];
    	p1 [ label = "foo" ];
    	p2 [ label = "bar" ];
    	p1 -> p2;
    }
    $ darcs w -s
    R ./foo
    $ # whoops, darcs got confused!
    $ darcs rev -a
    Finished reverting.
    $ darcs w -s
    No changes!
    $ echo baz >bar
    you have mail
    $ echo y | darcs ame -a bar
    Amending changes in "bar":

    Thu Nov  2 13:37:52 EST 2006  Trent Buck <trentbuck@gmail.com>
      * bar
    Shall I amend this patch? [yNvpq], or ? for help: 
    Finished amending patch:
    Thu Nov  2 13:55:39 EST 2006  Trent Buck <trentbuck@gmail.com>
      * bar
    $ darcs-deps 2>/dev/null
    digraph deps {
    	rankdir=LR;
    	node [ shape=box ];
    	p1 [ label = "foo" ];
    	p2 [ label = "bar" ];
    }
    $ 

Note that I am using the darcs-deps script from 

    http://scratchbox.org/~ttimonen/repos/darcs-deps

which outputs a dependency graph in graphviz dot format.  Lines of the
form

    p1 [ label = "foo" ];

create a node (p1) with the patch's description as its label (foo).
Lines of the form

    p1 -> p2

indicate a dependency (p2 depends on p1).

> The simplest solutions seems to be just copying the old explicit
> dependencies to the new patch, unless --ask-deps is used (this
> option needs to be added too, maybe as a separate issue), in
> which case the ask-deps dialogue should be rerun from scratsh, I
> think.

>From a user perspective, I think there are these situations:

  amend    --keep-old-explicit-deps    --ask-deps
  amend    --keep-old-explicit-deps --no-ask-deps
  amend --no-keep-old-explicit-deps    --ask-deps
  amend --no-keep-old-explicit-deps --no-ask-deps

The former option controlling whether the old explicit deps should be
inherited, the latter controlling whether darcs should prompt for
[additional] explicit deps.

I'm assuming there is some way to tell explicit deps from implicit
ones.

I can't think of a situation where you would want to keep (as opposed
to discarding and recalculating) implicit deps.
msg1222 (view) Author: kowey Date: 2006-11-15.02:15:31
> If this interests anyone, I'll take the time to produce a minimal
> example.

Yes, please.
msg1223 (view) Author: twb Date: 2006-11-15.02:35:49
On Wed, Nov 15, 2006 at 02:15:32AM +0000, Eric Kow wrote:
> 
> Eric Kow <eric.kow@gmail.com> added the comment:
> 
> > If this interests anyone, I'll take the time to produce a minimal
> > example.
> 
> Yes, please.

Done as http://bugs.darcs.net/msg1168
-- 
Trent Buck, Student Errant
msg1325 (view) Author: tommy Date: 2006-12-12.20:17:35
See Issue121 for adding the --ask-deps flag to amend-record.
msg1771 (view) Author: tommy Date: 2007-06-29.19:42:44
fixed in 1.0.9
History
Date User Action Args
2006-11-01 16:31:14trentbuckcreate
2006-11-01 20:57:00tommysetstatus: unread -> unknown
nosy: droundy, tommy, kowey, trentbuck
messages: + msg1166
2006-11-02 03:03:11trentbucksetnosy: droundy, tommy, kowey, trentbuck
messages: + msg1168
2006-11-15 02:15:32koweysetnosy: droundy, tommy, kowey, trentbuck
messages: + msg1222
2006-11-15 02:35:54trentbucksetnosy: droundy, tommy, kowey, trentbuck
messages: + msg1223
2006-12-12 20:17:44tommysetstatus: unknown -> resolved-in-stable
nosy: droundy, tommy, kowey, trentbuck
messages: + msg1325
2007-06-29 19:42:45tommysetstatus: resolved-in-stable -> resolved
nosy: + beschmi
messages: + msg1771
2009-08-06 17:40:08adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy, trentbuck
2009-08-06 20:37:11adminsetnosy: - beschmi
2009-08-10 21:58:05adminsetnosy: + trentbuck, - markstos, darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:53:42adminsetnosy: + darcs-devel, - simon
2009-08-27 13:49:21adminsetnosy: tommy, kowey, darcs-devel, trentbuck, thorkilnaur, dmitry.kurochkin