Issue 2183 prefs/{repos,sources,defaultrepo} are confusing and strange when repo is locally copied

Title prefs/{repos,sources,defaultrepo} are confusing and strange when repo is locally copied
Priority Status unknown
Milestone Resolved in
Superseder Nosy List owst
Assigned To

Created on 2012-04-20.22:06:54 by owst, last changed 2012-04-25.15:17:46 by kowey.

msg15594 (view) Author: owst Date: 2012-04-20.22:06:53
1. Summarise the issue (what were doing, what went wrong?)

I created a local copy of a repo that I had cloned from my server, using
`darcs get REPO REPO_2`. 

I then tried to push some patches, hoping to push to the remote server,
but darcs tried to push to the original local repo.

I then checked the prefs files:

$ for file in _darcs/prefs/{defaultrepo,repos,sources}; do echo "$file:
"; cat $file; echo ""; done



It seems we have some duplication here, what are these files used for?
The manual doesn't even mention defaultrepo!

I then tried to delete the local entry from sources, (which was
therefore still in the defaultrepo file) - trying to push, darcs didn't
complain, and still tried to push to the defaultrepo location!

Then, I tried deleting the defaultrepo entry, and pushing... darcs then
fails with:

  darcs failed:  Missing argument:  [REPOSITORY]
  Usage: darcs push [OPTION]... [REPOSITORY]

I shouldn't have to edit these files manually; darcs should help me out!

2. What behaviour were you expecting instead?

For *my* usecase, I'd like darcs to
a) Keep the remote as the defaultrepo and repos, when cloning locally.
b) Notice if I delete an entry from repos that is in defaultrepo and
complain/warn me.
c) Give me a way of getting darcs to use a different entry in
sources/repos for pushing/sending

I suppose there might be some usecases for keeping the local repo in
these files, but I'd at least like a get flag (--use-remote-as-default
or something).

3. What darcs version are you using? (Try: darcs --exact-version)

Latest screened:
2.9.1 (+ 401 patches)

4. What operating system are you running?
 Linux X86_64
msg15616 (view) Author: kowey Date: 2012-04-25.14:22:58
Comments on this vs issue1960?
msg15618 (view) Author: owst Date: 2012-04-25.14:28:08
So it's under the same umbrella, I think. 

Key things:
1) What happens to repo prefs when locally cloning a repo?
2) Why can't I choose a remote to push to?
3) Why isn't Darcs paying attention to my changes to the prefs files?
msg15621 (view) Author: kowey Date: 2012-04-25.15:17:45
So, it looks like #1 (what happens to repo prefs) should be a new ticket 
“document prefs system” (I'm thinking high-level technical document, eg. 

#2 might be issue1772

#3 not sure what to do with this, seems like I'd understand the question 
a bit better after we solve #1

(of interest is http://wiki.darcs.net/Internals/CacheSystem which should 
maybe be renamed to just Cache)
Date User Action Args
2012-04-20 22:06:54owstcreate
2012-04-25 14:22:59koweysetmessages: + msg15616
2012-04-25 14:28:09owstsetmessages: + msg15618
2012-04-25 14:30:18owstlinkissue1960 superseder
2012-04-25 15:17:46koweysetmessages: + msg15621