SVN X 仍然处于树冲突中

发布于 2024-08-28 10:44:25 字数 163 浏览 5 评论 0原文

我正在使用 VisualSVN(它使用 Tortoise)。我不小心将文件夹移动到其他位置。当尝试将其移回时,SVN 会出现此错误。它以前发生过一次,我设法做了一些随机更新/提交,不知道我在做什么,它被“修复”了。我无法再次发挥同样的魔力,所以我需要知道如何获取我的文件和目录以及树冲突。

谢谢!

I am using VisualSVN (which uses Tortoise). I accidentally move a folder to a different location. When tries to move it back, SVN pukes with this error. It happened once before and I managed to do some random updates/commits, not knowing what I was doing and it was "fixed". I cannot pull the same magic again, so I need to know how to get my files and directory and of tree-conflict.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

余厌 2024-09-04 10:44:25

我不确定它现在处于什么状态,但最好的选择可能是:

  1. 将文件夹完全移出存储库
  2. 执行 svn cleanup
  3. 执行 svn update
  4. 将文件从文件夹复制回来(不包含 .svn 文件),覆盖刚刚 svn 更新的旧源文件。

I'm not sure what state it's in now, but your best bet would probably be to:

  1. Move the folder out of your repository completely
  2. Do an svn cleanup
  3. Do an svn update
  4. Copy the files from the folder back (without the .svn files) overwriting the old source files that were just svn updated.
小…红帽 2024-09-04 10:44:25

我有同样的错误(树冲突),但来自不同的工作流程。

查找哪个进程拥有锁。下载 Handle.exe,然后打开您解压到的文件夹。然后运行“C:\path\handle.exe”“C:\path\FileOrFolder”

https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx重现

工作流程:

- delete folder (having one of the files locked by a program that is within this folder)
- commit parent folder of folder you deleted, and look for red text of the folder you deleted (it should be brown, not red if there aren't issues in SVN)

修复:

- forcefully kill the lock (or close the program so it releases the lock)
- run cleanup command on folder you deleted
- revert folder you deleted
- delete folder you deleted
- commit parent folder of folder you deleted

I had the same error (tree conflict), but from a different workflow.

Find what process has the lock. Download Handle.exe, and open to the folder you extracted to. Then run "C:\path\handle.exe" "C:\path\FileOrFolder".

https://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

Workflow to reproduce:

- delete folder (having one of the files locked by a program that is within this folder)
- commit parent folder of folder you deleted, and look for red text of the folder you deleted (it should be brown, not red if there aren't issues in SVN)

To fix:

- forcefully kill the lock (or close the program so it releases the lock)
- run cleanup command on folder you deleted
- revert folder you deleted
- delete folder you deleted
- commit parent folder of folder you deleted
橘和柠 2024-09-04 10:44:25

http://rubyjunction.us/subversion-hell-sh

编辑

这是链接中的 shell 脚本,对 Linux/Unix 用户可能有用......

#!/bin/sh

if [ "" == "$1" ] ; then
  echo "Usage: subversion-hell.sh A_PROJECT"
  echo "A_PROJECT should be a Subversion folder you are having problems with,"
  echo "and you should be in the folder above A_PROJECT"
fi

DIR=`pwd`
PWD=$DIR
DIR=`echo $DIR | sed s/^.*\\\/trunk/trunk/`

mkdir ~/tmp/       2>/dev/null
rm -Rf ~/tmp/$1   2>/dev/null
mv ~/$DIR/$1 ~/tmp/
find ~/tmp/$1/ -iname '.svn*' -exec rm -Rf {} \; 2>/dev/null
cd $PWD
echo svn co YOUR_URL_HERE/$DIR/$1 $1
svn co YOUR_URL_HERE/$DIR/$1 $1
cp -Rf ~/tmp/$1/* $PWD/$1/

# YOUR_URL_HERE can be found by looking in file .svn/entries, near the top

http://rubyjunction.us/subversion-hell-sh

Edit

Here's the shell script from the link, which could be useful to Linux/Unix users...

#!/bin/sh

if [ "" == "$1" ] ; then
  echo "Usage: subversion-hell.sh A_PROJECT"
  echo "A_PROJECT should be a Subversion folder you are having problems with,"
  echo "and you should be in the folder above A_PROJECT"
fi

DIR=`pwd`
PWD=$DIR
DIR=`echo $DIR | sed s/^.*\\\/trunk/trunk/`

mkdir ~/tmp/       2>/dev/null
rm -Rf ~/tmp/$1   2>/dev/null
mv ~/$DIR/$1 ~/tmp/
find ~/tmp/$1/ -iname '.svn*' -exec rm -Rf {} \; 2>/dev/null
cd $PWD
echo svn co YOUR_URL_HERE/$DIR/$1 $1
svn co YOUR_URL_HERE/$DIR/$1 $1
cp -Rf ~/tmp/$1/* $PWD/$1/

# YOUR_URL_HERE can be found by looking in file .svn/entries, near the top
南渊 2024-09-04 10:44:25

当我尝试删除Linux环境下的分支时,我遇到了同样的问题。我所做的是:

  1. svn revertbranch
  2. svnup
  3. svncleanupsvnremovebranch
  4. - 标记
    再次分支以删除
  5. svn ci

我不知道问题是什么,但我在两周内经历了两次。

I had the same problem when tried to delete a branch on linux enviroment. What I did was:

  1. svn revert branch
  2. svn up
  3. svn cleanup
  4. svn remove branch - mark the
    branch again for removal
  5. svn ci

I don't know what the problem was but I experienced it twice in two weeks.

蓝眼泪 2024-09-04 10:44:25

保留已移动的文件夹的备份。现在在 SVN 中,单击 TortoiseSVN>>已解决。
选择文件/文件夹并解决。现在更新/提交 svn 数据。

Keep a backup of the folder that you have moved. Now in SVN, click on TortoiseSVN>>Resolved.
Select the files/folder and resolve. Now update/commit the svn data.

a√萤火虫的光℡ 2024-09-04 10:44:25

请注意,即使您“没有执行任何操作”,也可能会发生这种情况 - 即有人在存储库中移动了您的文件夹而您对此一无所知。发生在我身上。如果是这种情况,请从存储库和 svn update 中删除问题文件夹。

开发人员移动/重命名/删除文件时会发生树冲突
或文件夹,其他开发人员也有
移动/重命名/删除或刚刚修改。有很多不同的
可能导致树冲突的情况,所有这些都需要
解决冲突的不同步骤。

Note that this can occur even if you "didn't do anything" - i.e. someone moves around folders on you in the repository and you don't know about it. Happened to me. If this is the case, delete the problem folder from your repository and svn update.

A tree conflict occurs when a developer moved/renamed/deleted a file
or folder, which another developer either also has
moved/renamed/deleted or just modified. There are many different
situations that can result in a tree conflict, and all of them require
different steps to resolve the conflict.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文