@@ -3755,8 +3755,11 @@ def _handle_rm(
3755
3755
cur = None
3756
3756
try :
3757
3757
ptop = dbv .realpath
3758
+ xlink = bool (dbv .flags .get ("xlink" ))
3758
3759
cur , wark , _ , _ , _ , _ = self ._find_from_vpath (ptop , volpath )
3759
- self ._forget_file (ptop , volpath , cur , wark , True , st .st_size )
3760
+ self ._forget_file (
3761
+ ptop , volpath , cur , wark , True , st .st_size , xlink
3762
+ )
3760
3763
finally :
3761
3764
if cur :
3762
3765
cur .connection .commit ()
@@ -3980,13 +3983,15 @@ def _mv_file(
3980
3983
if c2 and c2 != c1 :
3981
3984
self ._copy_tags (c1 , c2 , w )
3982
3985
3986
+ xlink = bool (svn .flags .get ("xlink" ))
3987
+
3983
3988
with self .reg_mutex :
3984
3989
has_dupes = self ._forget_file (
3985
- svn .realpath , srem , c1 , w , is_xvol , fsize_ or fsize
3990
+ svn .realpath , srem , c1 , w , is_xvol , fsize_ or fsize , xlink
3986
3991
)
3987
3992
3988
3993
if not is_xvol :
3989
- has_dupes = self ._relink (w , svn .realpath , srem , dabs )
3994
+ has_dupes = self ._relink (w , svn .realpath , srem , dabs , c1 , xlink )
3990
3995
3991
3996
curs .add (c1 )
3992
3997
@@ -4129,6 +4134,7 @@ def _forget_file(
4129
4134
wark : Optional [str ],
4130
4135
drop_tags : bool ,
4131
4136
sz : int ,
4137
+ xlink : bool ,
4132
4138
) -> bool :
4133
4139
"""
4134
4140
mutex(main,reg) me
@@ -4140,7 +4146,7 @@ def _forget_file(
4140
4146
if wark and cur :
4141
4147
self .log ("found {} in db" .format (wark ))
4142
4148
if drop_tags :
4143
- if self ._relink (wark , ptop , vrem , "" ):
4149
+ if self ._relink (wark , ptop , vrem , "" , cur , xlink ):
4144
4150
has_dupes = True
4145
4151
drop_tags = False
4146
4152
@@ -4172,7 +4178,15 @@ def _forget_file(
4172
4178
4173
4179
return has_dupes
4174
4180
4175
- def _relink (self , wark : str , sptop : str , srem : str , dabs : str ) -> int :
4181
+ def _relink (
4182
+ self ,
4183
+ wark : str ,
4184
+ sptop : str ,
4185
+ srem : str ,
4186
+ dabs : str ,
4187
+ vcur : Optional ["sqlite3.Cursor" ],
4188
+ xlink : bool ,
4189
+ ) -> int :
4176
4190
"""
4177
4191
update symlinks from file at svn/srem to dabs (rename),
4178
4192
or to first remaining full if no dabs (delete)
@@ -4188,6 +4202,8 @@ def _relink(self, wark: str, sptop: str, srem: str, dabs: str) -> int:
4188
4202
argv = (wark [:16 ], wark )
4189
4203
4190
4204
for ptop , cur in self .cur .items ():
4205
+ if not xlink and cur and cur != vcur :
4206
+ continue
4191
4207
for rd , fn in cur .execute (q , argv ):
4192
4208
if rd .startswith ("//" ) or fn .startswith ("//" ):
4193
4209
rd , fn = s3dec (rd , fn )
0 commit comments