You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Senthil Kumaran S <se...@collab.net> on 2007/07/12 12:25:10 UTC
loss of 'their file' upon non-existent EDITOR
Hi,
I would like to validate the following scenario:
When the conflict editor is called during an update and there is no
default editor
application, then it does not try to merge the working copy with new
incoming change('their file'), i.e the behavior is like 'accept my
version of file' whereas it should have been like 'no-update at all' to
give an opportunity for future updates.
The following script explains this scenario:
<snip>
$SVNADMIN create /tmp/repos1
$SVN co file:///tmp/repos1 repos1_wc1
cd repos1_wc1
echo "hello" > test.c
$SVN add test.c
$SVN ci -m 'ww'
cd ..
$SVN co file:///tmp/repos1 repos1_wc2
cd repos1_wc1
echo "Hello" > test.c
$SVN ci -m 'ww'
cd ..
cd repos1_wc2
echo "hEllo" > test.c
$SVN up
</snip>
When we run the above script we get a prompt for conflict resolution in
the interactive mode like the following:
<snip>
Select: (p)ostpone, (d)iff, (e)dit, (h)elp :
</snip>
If I give 'e', when my $EDITOR environment variable is not set, it will
fail to open the editor and quits the interactive mode with the
following error:
<snip>
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is
set, and no 'editor-cmd' run-time configuration option was found
</snip>
Now when I do a "svn st" inside repos1_wc2 I get the status as:
<snip>
! .
M test.c
</snip>
which obviously loses .their file and merges with .mine file. I think
this should not be the exact intended behavior (instead it should leave
the file in the C ie., conflicted state). I tried writing a test case
for this in our python test suite, but could'n do it, because I am
unaware of how to pass the 'e' option to run_and_verify_update method :(
Before I write a test case for this scenario by correcting the
run_and_verify_update() to accept the 'e' option, I would like to
validate this scenario.
--
Senthil Kumaran S
http://www.stylesen.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: loss of 'their file' upon non-existent EDITOR
Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 7/12/07, Senthil Kumaran S <se...@collab.net> wrote:
> > found" svn_error_t, and clear the error. If there's no editor
> > available, the user should simply be re-prompted with the conflict
> > menu again. I can fix that in just a moment.
>
> I think this will be an ideal fix to do.
Fixed in r25719.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: loss of 'their file' upon non-existent EDITOR
Posted by Senthil Kumaran S <se...@collab.net>.
Ben Collins-Sussman wrote:
> Huh? How is anything lost? The update simply aborted. If you 'svn
> diff test.c', you should still see your local edit, as if you had
> never run 'svn up'.
I feel that, when we are not changing anything using the editor and
failing, we must not change the status ie., from C to M and quit.
For example, when we change the status to M, In this case if I do a svn
up for the second time, there is no error displayed and .mine is applied
on the wc, in which case .their is lost. This may be an intended
behavior, please correct me if I am wrong.
> found" svn_error_t, and clear the error. If there's no editor
> available, the user should simply be re-prompted with the conflict
> menu again. I can fix that in just a moment.
I think this will be an ideal fix to do.
--
Senthil Kumaran S
http://www.stylesen.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: loss of 'their file' upon non-existent EDITOR
Posted by Kamesh Jayachandran <ka...@collab.net>.
> Huh? How is anything lost? The update simply aborted. If you 'svn
> diff test.c', you should still see your local edit, as if you had
> never run 'svn up'.
Ben, after this 'no editor failure' working copy revision moves up to
'latest' and hence no further updates are possible at all, I tried 'svn
revert problematic_file' and tried 'svn up' I could not get the latest
content.
Path: test.c
Name: test.c
URL: file:///tmp/repos1/test.c
Repository Root: file:///tmp/repos1
Repository UUID: c58e9a57-1135-0410-b94f-b241ce3a3ca8
Revision: 1
Node Kind: file
Schedule: normal
Last Changed Author: kamesh
Last Changed Rev: 1
Last Changed Date: 2007-07-12 19:25:08 +0530 (Thu, 12 Jul 2007)
Text Last Updated: 2007-07-12 19:25:09 +0530 (Thu, 12 Jul 2007)
Checksum: b1946ac92492d2347c6235b4d2611184
Conflict discovered in 'test.c'.
Select: (p)ostpone, (d)iff, (e)dit, (h)elp : e
../subversion/svn/util.c:135: (apr_err=205007)
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is
set, and no 'editor-cmd' run-time configuration option was found
Path: test.c
Name: test.c
URL: file:///tmp/repos1/test.c
Repository Root: file:///tmp/repos1
Repository UUID: c58e9a57-1135-0410-b94f-b241ce3a3ca8
Revision: 2
Node Kind: file
Schedule: normal
Last Changed Author: kamesh
Last Changed Rev: 2
Last Changed Date: 2007-07-12 19:25:10 +0530 (Thu, 12 Jul 2007)
Checksum: b1946ac92492d2347c6235b4d2611184
[kamesh@kamesh repos1_wc2]$ /home/kamesh/pure_trunk-neon/bin/svn cat -r2
file:///tmp/repos1/test.c
Hello
[kamesh@kamesh repos1_wc2]$ /home/kamesh/pure_trunk-neon/bin/svn up
At revision 2.
[kamesh@kamesh repos1_wc2]$ /home/kamesh/pure_trunk-neon/bin/svn cat -r2
file:///tmp/repos1/test.c
Hello <--- in the repo
[kamesh@kamesh repos1_wc2]$ /home/kamesh/pure_trunk-neon/bin/svn di test.c
[kamesh@kamesh repos1_wc2]$ cat test.c
hello <---see what pristine copy of failed update resulted in
With regards
Kamesh Jayachandran
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: loss of 'their file' upon non-existent EDITOR
Posted by Ben Collins-Sussman <su...@red-bean.com>.
On 7/12/07, Senthil Kumaran S <se...@collab.net> wrote:
> If I give 'e', when my $EDITOR environment variable is not set,
...actually, we check for $EDITOR, $SVN_EDITOR, and also an
'editor-cmd' variable in ~/.subversion/config. If all of those fail,
*then* we throw the error. :-)
> <snip>
> svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is
> set, and no 'editor-cmd' run-time configuration option was found
> </snip>
>
> Now when I do a "svn st" inside repos1_wc2 I get the status as:
>
> <snip>
> ! .
> M test.c
> </snip>
>
> which obviously loses .their file and merges with .mine file.
Huh? How is anything lost? The update simply aborted. If you 'svn
diff test.c', you should still see your local edit, as if you had
never run 'svn up'.
However, I agree that the proper behavior here is for our
conflict-callback implementation to catch the specific "editor not
found" svn_error_t, and clear the error. If there's no editor
available, the user should simply be re-prompted with the conflict
menu again. I can fix that in just a moment.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org