简体   繁体   English

合并将始终更新文件的修订号吗?

[英]Will a merge always update the revision number of a file?

Lets say that I'm merging a directory from branch-alpha into trunk . 可以说我正在将一个目录从branch-alpha合并到trunk There is a new file called phi.txt in branch-alpha that will be merged into trunk. branch-alpha中有一个名为phi.txt的新文件,它将被合并到主干中。 Will the revision of phi.txt change? phi.txt的修订版phi.txt更改吗?

I sense terminological/conceptual problem ;-) 我感觉到术语/概念问题;-)

In Subversion, files do not have revision numbers (as opposed to, say, CVS). 在Subversion中,文件没有修订号(例如CVS)。 Revision number is a property of a commit. 修订号是提交的属性。

But, any given file might be present or absent in a particular revision, and have a particular state in it. 但是,任何给定的文件在特定版本中可能存在或不存在,并且其中具有特定状态。

Say, given a series of revisions …→ @10@11@12 …, a particular file might have been changed in the @11 th revision, but you still are able to refer to the contents of that file using any of these revision numbers, just referring to that via @10 will give the "old" contents, and via @11 and @12 will give the "new" (and the same) contents—that is, until some future revision, @N in which that file will be changed again. 假设给出了一系列修订…→ @10@11@12 …,某个特定文件可能已在第@11个修订中进行了更改,但是您仍然可以使用以下任意文件来引用该文件的内容版本号,仅通过@10引用将给出“旧”内容,而通过@11@12给出“新”(且相同)内容-也就是说,直到将来的某个修订, @N该文件将再次更改。 And then referring to it via some past revision @P P<N will refer to the file's contents as found in rev. 然后通过以前的修订版本@P P <N引用它,将引用在rev中找到的文件内容。 @11 , and using future revision numbers @F F>N will refer to its contents as recorded in @N . @11 ,并使用将来的修订版本号@F F> N将引用@N记录的内容。

Answering the question directly now: 现在直接回答问题:

  • The contents of the file may change if and only if it will be updated by that merge. 该文件的内容可能会更改,并且仅当它将通过该合并进行更新时。
  • The merge will definitely create a new revision, but that will be the repository-wide revision, not a revision of that particular file (or any other file in the repositry). 合并肯定会创建一个新修订,但这将是存储库范围的修订,而不是该特定文件(或存储库中任何其他文件)的修订。
  • After the merge, if the file's contents was updated, referring to it via the merge commit's revision number will refer to the updated file's contents, and referring to it using, say, the revision number immediately preceding that of the merge commit will refer to the file's "previous" contents. 合并之后,如果文件的内容已更新,则通过合并提交的修订版本号引用该文件的内容将引用更新的文件的内容,例如,使用紧接合并提交的修订版本号的版本号进行引用。文件的“上一个”内容。

Just in case you didn't know, you can refer to the state of a particular file as found in a particular revision using path/to/the/file@rev like in app/js/foo.js@12345 . 以防万一,您可以使用app/js/foo.js@12345 path/to/the/file@rev app/js/foo.js@12345在特定修订版中找到的特定文件的状态。

Is it clear now? 现在清楚了吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM