bugmonotone - Bugs: bug #9231, Monotone does not handle symlinks

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #9231: Monotone does not handle symlinks

Submitter:  None
Submitted:  Sat 05 Jun 2004 08:38:00 PM UTC
Votes: 5
 
Category:  working copy Severity:  3 - Normal
Item Group:  feature request Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
mtn version --full: 


Jump to the original submission

Sat 08 May 2010 07:49:00 PM UTC, comment #6: 

Just to clarify; this is talking about symlinks within the workspace, not symlinks to files outside the workspace. It would be useful for mtn to preserve in-workspace symlinks. For example, /etc often has them.

Stephen Leake <stephen_leake>
Group Member
Sat 08 May 2010 07:42:50 PM UTC, comment #5: 

The problem is that symlinks are simply lost, while they should get a special file attribute which stores the original symlink and creates that instead on update / checkout / revert on supported platforms:

$ mtn setup .
$ touch foo
$ ln -s foo bar
$ mtn add bar
$ mtn ci -m "test"
$ file -h bar
bar: symbolic link to foo
$ rm bar
$ mtn revert --missing
$ file -h bar
bar: UTF-8 Unicode text


Thomas Keller <tommyd>
Group administrator
Sat 08 May 2010 07:30:39 PM UTC, comment #4: 

I'm not clear what the original problem is.

Win32 certainly does not support symlinks; trying to add mtn code to fake that is not a good idea.

Cygwin does support symlinks; use that instead.

Stephen Leake <stephen_leake>
Group Member
Mon 27 Jun 2005 02:26:59 AM UTC, comment #3: 

[PATCH] Symbolic link support for monotone.

An all Lua solution is not possible AFAICT.
You must patch/compile the monotone c++ sources.
This is because monotone will walk directories pointed to by symlinks, or complain if the linked path does not exist.

The implementation here adds the symlink as if it were a normal file, containing SyMlInK:<linked path>
This file will be written out by monotone.
When symlink "true" is present in .mt-attrs (added by the add command),
the file is read, unlinked, then a symbolic link created in its place.

If you set the symlink attr of a normal file to true, then the file is checked for the "SyMlInK:" and a warning is issued if not found. So if you value your sanity, do not set the symlink attr on normal files starting with "SyMlInK:"
If you are already insane, feel free to change SYMLINK_MAGIC in unix/process.cc to something like "#include"

On Win32, not tested, but on checkout the normal file should be written out as above, but not unlinked.

Ryan Nielsen <ran>
Thu 21 Apr 2005 01:25:38 PM UTC, comment #2: 

Does anyone have existing Lua code that handles symlinks via a hook function / the .mt-attrs file?

Daniel Clark <dcca2302>
Sun 20 Jun 2004 08:04:24 PM UTC, comment #1: 

Just read the manual in its entirety. This should actually be very easy to add with some addition to the hook that handles the .mt-attrs file...

It would be nice if the .mt-attrs file would be handled automatically. I.e. by adding a hook that creates/updates the file on commits.

Anonymous
Sat 05 Jun 2004 08:38:00 PM UTC, original submission:  

Hi!

I just tried to import my homedir (8GiB of misc files) into monotone. It worked out surprisingly well!

One thing I found annoying though is that MOnotone can not handle symlinks. It would be nice to have that added. This would allow for managing your /etc dir with monotone;-)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #3127:  monotone-symlink-patch-0.19.diff added by ran (11KiB - text/x-patch - Symbolic link support (0.19) USE THIS, NOT file #2634)
file #3126:  monotone-symlink-patch-0.19.diff added by ran (16KiB - text/x-patch - Symbolic link support for monotone 0.19)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tommyd (Posted a comment)
  • -email is unavailable- added by stephen_leake (Posted a comment)
  •  

    There are 5 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2006-08-23 lapo Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added lapo
    2005-06-27 ran Attached File- Added monotone-symlink-patch-0.19.diff, #2635
    2005-06-27 ran Attached File- Added monotone-symlink-patch-0.19.diff, #2634
        Carbon-Copy- Added -email is unavailable-
    2005-04-21 dcca2302 Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code