使用 Fossil DVCS 重命名目录

发布于 2024-08-14 07:20:41 字数 233 浏览 3 评论 0原文

是否可以使用 Fossil 重命名目录?我尝试了明显的命令:

fossil mv oldname newname

化石然后通知我它已经做了一些事情:

RENAME oldname newname

但是,调用“化石更改”会导致一个空列表。据我所知,重命名目录要么不受支持,要么尚未实现,要么只是被破坏。这有什么技巧吗?

Is it possible to rename directories with Fossil? I've tried the obvious command:

fossil mv oldname newname

Fossil then informs me that it has done something:

RENAME oldname newname

However, calling "fossil changes" results in an empty list. As far as I can tell, renaming directories is either not supported, not yet implemented or just broken. Is there a trick to this?

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

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

发布评论

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

评论(1

§普罗旺斯的薰衣草 2024-08-21 07:20:41

经过一番研究,我发现这是可以做到的,但这是违反直觉的。 Fossil 并不真正关心目录会发生什么;它所关心的是其中文件的位置。

重命名目录时,Fossil 会:

  • 循环浏览旧目录的存储库文件列表;
  • 在文件系统上的新目录中找到该文件;
  • 更新文件的元数据,以便将它们列为新目录的一部分。

如果新目录不存在,则此操作失败。新位置中没有文件,因此 Fossil 无法将新旧位置匹配,因此不会进行任何更改。

简而言之:在尝试对 Fossil 进行更改之前,您必须通过文件系统重命名该文件夹。如果你不这样做,Fossil 就会忽略你。

现在我想了一下,这是有道理的,尽管我更希望 Fossil 只更新文件系统本身,而不是强迫用户执行两步过程。

作为附录,似乎不可能向 Fossil 添加空目录。我假设它在内部只存储文件;文件夹被视为元数据。空文件夹是不描述任何内容的元数据,因此添加它们没有任何意义。

After some research I've found that it can be done, but it is counter-intuitive. Fossil doesn't really care what happens to directories; all it cares about is the location of the files within them.

When renaming a directory, Fossil appears to:

  • loop through the repository's list of files for the old directory;
  • locate the file in the new directory on the filesystem;
  • update the files' metadata so that they are listed as being part of the new directory.

If the new directory does not exist, this fails. There are no files in the new location so Fossil cannot match up the old with the new, so no changes are made.

In short: You must rename the folder via the filesystem before you try to make the change to Fossil. If you don't, Fossil ignores you.

Now that I think about it, this makes sense, though I'd prefer it if Fossil would just update the filesystem itself instead of forcing a two-step process on its users.

As an addendum, it appears to be impossible to add an empty directory to Fossil. I assume that internally it stores just files; folders are considered to be metadata. An empty folder is metadata describing nothing, so adding them makes no sense.

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