Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conflict for property svn:ignore?

Tags:

svn

How do I resolve a conflict for the svn:ignore property?

I ignored some files in my local repository using the below command:

svn propedit svn:ignore .

When I ran svn update, I saw the below conflict:

Conflict for property 'svn:ignore' discovered on ''

When I run svn diff, I see the below differences:

Property changes on: .
___________________________________________________________________
Modified: svn:ignore
   -

   + cache/*
log/*

How can I resolve this conflict? I want to remove my local modifications for svn ignore.

like image 911
Tanu Gupta Avatar asked Mar 23 '23 16:03

Tanu Gupta


2 Answers

File attributes are just like the contents of a file in Subversion. They too require a commit to be modified and can be in conflict.

Do an svn status and you'll see more of a description of the conflict. There are three possibilities:

  • Incoming edit and local edit: Both you and the previous version edited this attribute. Should have been able to do a merge.
  • Incoming add and local add: You added this attribute, and so did someone else.
  • Incoming delete and local edit or add: A revision wars -- this attribute was in a previous revision of the repository, and that person deleted this attribute. You've edited it.

There are two ways to solve this issue:

  • Do a revert on this attribute. If you added it, do a svn propdel --force on it. Because this is a directory, don't do a svn revert . because you'll revert all the changes in this directory. you don't want to do that. Just revert this attribute. You maybe able to revert just the attribute by doing a svn revert --depth=empty . I never tried that.
  • Do a svn resolved .. This will mark the conflict in . as resolved. It's not necessarily resolved, but you can at least mark it as such and fix it later.

If you reverted the property change, and resolved the conflict that way, do an svn update and reedit the property. If you did an svn resolved . on the conflict, then take a look at the value of the previous revision by doing a svn propget -rPREV svn:ignore .. This way, you can see what the previous revision set it to, and take that into account. It could be a simplle ordering issue. For example, the previous revision set it to:

target
build.properties

You set it to:

build.properties
target

In the end, both are the same value. Or, it could be that the previous revision had a directory of file name in there that you didn't have. For example, it was set to:

*.log

and you set it to:

build.properties
target

You probably want to set it to:

build.properties
target
*.log

First resolve the conflict, do an update, and then set it to the value you need.

like image 141
David W. Avatar answered Apr 07 '23 02:04

David W.


svn:ignore is a property of the parent folder that contains the files you have set to be ignored. It is that folder, therefore, that is exhibiting a conflict.

Plan A The easiest solution is to delete that containing folder then do an SVN update to restore it as it exists in the repository.

Plan B If deleting the folder is not an option for you for some reason (e.g. if you have some modified files you want to keep) then rename the folder (e.g. to yourfolder-TEMP) and again do an SVN update. This recreates yourfolder with no conflict in the svn properties. Now copy back the files you need from yourfolder-TEMP to yourfolder and then delete the old folder once you are satisfied you have preserved what you need.

like image 39
Michael Sorens Avatar answered Apr 07 '23 02:04

Michael Sorens