1. Summarise the issue (what were doing, what went wrong?)
I get a "Failed to commute common patches" error when I do the following.
Summary:
* Create two patches. P: create file "f", Q: add text to "f".
* In a new repo, make a new patch R: create file "f". (In the error message below, this patch is "version B".)
* Pull patches P and Q into the new repo.
* Obliterate P in the new repo. (Originally, Q depended on P, but darcs seems happy to let me obliterate P, maybe because R does the same thing.
* Pull P again from the old repo to the new.
At this point, I see:
james angel ~/tmp/B $ darcs pull ../A
HINT: if you want to change the default remote repository to
/home/james/tmp/A,
quit now and issue the same command with the --set-default flag.
darcs: This is a bug! Please report it at http://darcs.net
Failed to commute common patches:
patch d469bc34b05d89c04ad260037ad559b1daafd667
Author: jcook@cs.berkeley.edu
Date: Wed Jul 1 16:22:53 UTC 2020
* Add stuff to f.
patch 1e4f99523033230bf343c8d6a0f5502304423c4c
Author: jcook@cs.berkeley.edu
Date: Wed Jul 1 16:23:17 UTC 2020
* Add f (version B).
CallStack (from HasCallStack):
error, called at src/Darcs/Prelude.hs:71:11 in darcs-2.14.2-FwKSYNegFf78c2JxGuvUka:Darcs.Prelude
As shell commands (I could probably make this non-interactive if it helps). I added some comments about minimal contexts because there's a thread about those on darcs-users that I plan to reply to using this as an example.
mkdir A; cd A
darcs init
touch f; darcs add f
darcs record -am "Add f (version A)."
echo "stuff" > f
darcs record -am "Add stuff to f."
# The minimal context of "Add stuff to f." is one patch, "Add f (version A)"
cd ..; mkdir B; cd B
darcs init
touch f; darcs add f
darcs record -am "Add f (version B)."
darcs pull ../A
# Choose all patches. (Darcs won't let me just choose "Add stuff to f." without "Add f (version A)." at this point.)
# (At this point, I don't think "Add stuff to f." has a well-defined minimal context, based on what comes next.)
darcs obliterate
# Choose just "Add f (version A)."
# Now, the minimal context of "Add stuff to f." is "Add f (version B)"
darcs pull ../A
# This is where the error message appears.
2. What behaviour were you expecting instead?
I didn't have any particular expectation, other than darcs not crashing. This was an experiment to understand whether darcs lets me replace a depended-on patch with its duplicate.
Based on an ongoing discussion in darcs-users, I suspect darcs shouldn't have let me obliterate the patch "Add f (version A)".
3. What darcs version are you using? (Try: darcs --exact-version)
darcs compiled on Jan 26 2019, at 14:14:51
Weak Hash: not available
Context:
[TAG 2.14.2
Ganesh Sittampalam <ganesh@earth.li>**20190126112346
Ignore-this: 5c94e042fbcfdf311008d6e980d9cf1d
]
4. What operating system are you running?
Linux (NixOS 20.04)
|