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

Submitted by:  None
Submitted on:  Sat 05 Jun 2004 08:38:00 PM UTC  
Votes:  5  
 
Category: working copySeverity: 3 - Normal
Item Group: feature requestStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open
mtn version --full: 

(Jump to the original submission 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>
Project 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>
Project 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>
Project 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

 

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
  • -unavailable- added by tommyd (Posted a comment)
  • -unavailable- added by stephen_leake (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 5 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 23 Aug 2006 01:34:47 PM UTClapoCarbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added lapo
    Mon 27 Jun 2005 02:32:45 AM UTCranAttached File-=>Added monotone-symlink-patch-0.19.diff, #2635
    Mon 27 Jun 2005 02:26:59 AM UTCranAttached File-=>Added monotone-symlink-patch-0.19.diff, #2634
      Carbon-Copy-=>Added -unavailable-
    Thu 21 Apr 2005 01:22:43 PM UTCdcca2302Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1