SVN配置 svn:needs-lock commit提交后,图标为灰色,文件为只读。

方式一: 修改配置文件

 

1 找到 # enable-auto-props = yes,去掉前面的注释

enable-auto-props = yes

 

2 找到 [auto-props]、在后面添加

*.txt = svn:needs-lock=yes

----------------------------------------------------

 

### conflict files use custom extensions.
# preserved-conflict-file-exts = doc ppt xls od?
### Set enable-auto-props to 'yes' to enable automatic properties
### for 'svn add' and 'svn import', it defaults to 'no'.
### Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes
### Set interactive-conflicts to 'no' to disable interactive
### conflict resolution prompting.  It defaults to 'yes'.
# interactive-conflicts = no

### Section for configuring automatic properties.
[auto-props]
### The format of the entries is:
###   file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and
### '?').  All entries which match (case-insensitively) will be
### applied to the file.  Note that auto-props functionality
### must be enabled, which is typically done by setting the
### 'enable-auto-props' option.
# *.c = svn:eol-style=native
# *.cpp = svn:eol-style=native
# *.h = svn:eol-style=native
# *.dsp = svn:eol-style=CRLF
# *.dsw = svn:eol-style=CRLF
# *.sh = svn:eol-style=native;svn:executable
# *.txt = svn:eol-style=native
# *.png = svn:mime-type=image/png
# *.jpg = svn:mime-type=image/jpeg
# Makefile = svn:eol-style=native

*.txt = svn:needs-lock=yes


 -----------------------------------------------

方式二: 修改配置文件

 

属性->Subversion选项夹->properties->add,然后在弹出的窗口中的property name选择“svn:needs-lock”,值任意,然后选择OK。之后再提交

-------------------------------------------------

 

通过方式一,提交后的文件直接就是只读的。

------------------------------------------------

 

这种方式的好处是,只有获得锁,才能对文件进行修改并提交。

防止因为修改了文件,又不小心对文件进行了提交操作。

 

你可能感兴趣的:(properties,SVN,import,makefile,conflict)