English 中文(简体)
能够设立特别志愿人员,以便在清点档案时发出警告?
原标题:Can SVN be set up to emit a warning when comitting a file?
  • 时间:2011-10-17 13:50:42
  •  标签:
  • svn

今天,我注意到,一周前,我曾意外地修改了我 should的档案,并与其他人一起承诺这样做。 我想的是,如果你可以把某些档案藏匿在特别志愿人员协会中的话,那将是ice笑的,因为“你可能不想这样做”。 也就是说,如果我意外地篡改这一档案,那么我会问: “你是否确信你想要完成这一档案?” 我不想一帆风顺,因为可能有一些少见的合法案例来触及这些档案。

能否做到这一点?

问题回答

我将用锁子这样做,你可以在你想要思考的每个档案中增加一锁,然后与你为此目的而创建的特别用户一道做两次(见notSoFast)。

这样,每当你试图用notSoFast锁住的档案时,都会这样做。 如果你真的需要更新这一档案,你就可以(a) 作为用户(notSoFast)进行这一档案记录,或(b)从用户中删除24小时,进行改动,然后将档案交给用户。

我要谈谈“mtrovo”告诉你,这里是另一个难以执行的方案:

TortoiseSVN 允许你(我想从1.6.x版本)使用客户 h。 客户栏目与服务器对等同,但客户方。 你可以把一些信息添加到你的档案中,并视这一信息,添加一个方言,请你保存信息是否适当。 你们必须采取以下步骤,以找到一种解决办法:

  1. Add a client pre-commit hook. The reason for the pre-commit is, that the list of files is available, and the result of the pre-commit is true or false. So you may cancel if the user not explicitly allows to commit the files.
  2. Add as svn:property to your files that should be checked before commited by the user. You could name it e.g. svn:needs-ok with some value.
  3. Every time you want to commit something, it will be checked by your script, that
    • if a file has the property svn:needs-commit,
    • it will start a dialog with that information, and the buttons OK and Cancel.
  4. Depending on the dialog answer, the script returns true or false.
  5. You have to ensure that
    • all clients have installed your client pre-commit hook and
    • all files that need to be checked have that property svn:needs-ok set.

我不认为,这是一个能够充分发挥作用的解决方案,足以满足以下条件:

我有2个pre-commit hooks。 这可能是你想要的:

  • 第一个是我所说的话:/em>,因为它有很多 st。 您可以说明的内容之一是允许谁更改特定档案。 例如,大多数用户可将这些档案编成只读<>em>,但仍需允许特定用户在需要时对其进行修改。 它由控制档案控制,因此,你不必修改文字。

  • 第二点是一份通知,让用户能够具体说明他们想要观察哪些档案。 如果对监控档案进行了修改,用户就会收到电子邮件。 例如,技术主任可以观察这些特定档案,并在这些档案发生变化时收到通知。 如果开发商有权修改档案,他们可能会忽视这一问题。 如果开发商被授权进行变革,这种变化可以迅速恢复。

The first approach will prevent the change, but it means that if a change is required, making the change could be a pain since you have to ask a particular person to make the change. In the second approach, unauthorized changes could still take place, but whomever is responsible will quickly be notified and can revert the change. Normally, if a developer knows someone is watching them, they ll be more careful.

这些网关使用Perl,但没有非标准模块,因此没有必要从国家计算机网络下载和安装某些地点可能难以使用的单元。

对于已经处于版本控制之中并且没有被忽视的档案,你可以采用预先判断的办法处理这些档案,以拒绝这一改动,但允许在评论中“使用”可能会使预先承诺被忽视。 如果该评论有“我确信因为”的案文,那么它将允许该承诺。





相关问题
Best practices for Subversion and Visual Studio projects

I ve recently started working on various C# projects in Visual Studio as part of a plan for a large scale system that will be used to replace our current system that s built from a cobbling-together ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...