附录 F. 实现细节

Posted on Posted in 8.附录

附录 F. 实现细节

目录

This appendix contains a more detailed discussion of the implementation of some of TortoiseSVN's features.

图标重载

Every
 file and folder has a Subversion status value as reported by the
 Subversion library. In the command line client, these are represented
by  single letter codes, but in TortoiseSVN they are shown graphically
 using the icon overlays. Because the number of overlays is very
limited,  each overlay may represent one of several status values.

The Conflicted overlay is used to represent the conflicted
 state, where an update or switch results in conflicts between local
 changes and changes downloaded from the repository. It is also used to
 indicate the obstructed state, which can occur when an operation is unable to complete.

The Modified overlay represents the modified state, where you have made local modifications, the merged state, where changes from the repository have been merged with local changes, and the replaced state, where a file has been deleted and replaced by another different file with the same name.

The Deleted overlay represents the deleted state, where an item is scheduled for deletion, or the missing
 state, where an item is not present. Naturally an item which is
missing  cannot have an overlay itself, but the parent folder can be
marked if  one of its child items is missing.

The Added overlay is simply used to represent the added status when an item has been added to version control.

The In Subversion overlay is used to represent an item which is in the normal
 state, or a versioned item whose state is not yet known. Because
 TortoiseSVN uses a background caching process to gather status, it may
 take a few seconds before the overlay updates.

The Needs Lock overlay is used to indicate when a file has the svn:needs-lock property set. For working copies which were created using Subversion 1.4.0 and later, the svn:needs-lock
 status is cached locally by Subversion and this is used to determine
 when to show this overlay. For working copies which are in pre-1.4.x
 format, TortoiseSVN shows this overlay when the file has read-only
 status. Note that Subversion automatically upgrades working copies when
 you update them, although the caching of the svn:needs-lock property may not happen until the file itself is updated.

已经锁定覆盖用于本地工作副本持有此文件的锁。

The Ignored overlay is used to represent an item which is in the ignored state, either due to a global ignore pattern, or the svn:ignore property of the parent folder. This overlay is optional.

The Unversioned overlay is used to represent an item which is in the unversioned state. This is an item in a versioned folder, but which is not under version control itself. This overlay is optional.

If an item has subversion status none (the item is not within a working copy) then no overlay is shown. If you have chosen to disable the Ignored and Unversioned overlays then no overlay will be shown for those files either.

每个条目只有一个 Subversion 状态。例如一个文件可以被本地修改,同时被标记为删除。Subversion 返回一个状态 – 即已经删除。这些优先级是 Subversion 自己定义的。

当 TortoiseSVN 递归显示状态时(默认配置),每个目录用重载图标显示自己的状态和所有子孙的状态。为了显示单个概要重载,我们使用上述优先级决定使用哪个重载,冲突重载使用最高优先级。

In
 fact, you may find that not all of these icons are used on your
system.  This is because the number of overlays allowed by Windows is
limited to  15. Windows uses 4 of those, and the remaining 11 can be
used by other  applications. If there are not enough overlay slots
available,  TortoiseSVN tries to be a “Good Citizen (TM)” and limits its
use of overlays to give other apps a chance.

  • Normal, Modified and Conflicted are always loaded and visible.

  • Deleted is loaded if possible, but falls back to Modified if there are not enough slots.

  • Read-Only is loaded if possible, but falls back to Normal if there are not enough slots.

  • Locked is only loaded if there are fewer than 13 overlays already loaded. It falls back to Normal if there are not enough slots.

  • Added is only loaded if there are fewer than 14 overlays already loaded. It falls back to Modified if there are not enough slots.