Issue 114: list databases / list workspaces does not display symlinked databases / workspaces properly

Reported by Richard Levitte, Nov 28, 2010

Steps to reproduce the problem:

1. move a database from previous repository place to the default 
database directory, but make sure to not break existing workspaces:
    mv ~/monotone-repos/ ~/.monotone/databases/
    ln -s ~/.monotone/databases/ ~/monotone-repos/
2. list available databases:
    mtn list databases

Expected result:
---------------- (in /home/levitte/.monotone/databases): (in /home/levitte/tmp/foo)

Actual results:
--------------- (in /home/levitte/.monotone/databases):
	no known valid workspaces

Output of `mtn version --full`:

monotone 0.99.1 (grundrevision: 
Kör på               : Linux 2.6.32-5-686 #1 SMP Sat Oct 30 22:47:19 
UTC 2010 i686
C++-kompilator       : GNU C++ version 4.4.5
C++-standardbibliotek: GNU libstdc++ version 20101029
Boost-version        : 1_42
SQLite-version       : 3.7.3 (kompilerad gentemot 3.7.3)
Lua-version          : Lua 5.1
PCRE-version         : 8.02 2010-03-19 (kompilerad gentemot 8.2)
Botan-version        : 1.8.9 (kompilerad gentemot 1.8.9)
Ändringar sen basrevisionen:
format_version "1"

new_manifest [c1270158b7fa91abf8235ad129b0476943bde1ed]

old_revision [8973482283db7c36780dce2b54721ccc0f5b7388]

  Generated from data cached in the distribution;
  further changes may have been made.

Comment 1 by Richard Levitte, Nov 28, 2010

I forgot to mention I had done this as well:

    cd ~/tmp/foo
    mtn register

The problem is, of course, that monotone tries to check if the 
database pointed at in the workspace is the same as the one being 
listed, doesn't resolve symlinks before the comparison, so the 
registered workspace doesn't seem to be the one connected to that 
database after all, and is therefore not displayed or counted.

Comment 2 by Thomas Keller, Nov 29, 2010

I think we have almost no special handling for symlinks in monotone 
at all. And while this mostly works as it should (for example when 
you work on a symlinked database where we give the symlink to sqlite 
and this does the actual work), it breaks for use cases like the one 

Now we could add another requirement "all symlinks 
resolved" to our "normalized paths" definition in src:, but I doubt this is either an easy task 
(handling symlink loops) nor something which comes without cost 
(slower path handling and / or unwanted or unexpected behaviour). 
This doesn't say we shouldn't do it, but I'd strongly vote to do 
this after 1.0 and rather point the user to list the new database 
location as additional location via the 
get_default_database_locations lua hook.

Comment 3 by Thomas Keller, Feb 21, 2011

Summary: list databases / list workspaces does not display symlinked databases / workspaces properly

Created: 13 years 7 months ago by Richard Levitte

Updated: 13 years 4 months ago

Status: New

Followed by: 1 person

Type:Incorrect Behavior

Quick Links:    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status