You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Weintraub <qa...@gmail.com> on 2009/05/04 21:10:01 UTC

How does Undoing Change Show Up in History

I have a question about how does undoing a change show up in the history:

I created a new repository and added a single file into that repository:

$ vi foo.txt
$ cat foo.txt
this is line #1
this is line #2
this is line #3 (DELETE)

$ svn add foo.txt
A         foo.txt

$ svn commit -m

$ svn commit
Adding         foo.txt
Transmitting file data .
Committed revision 1.
$ svn log foo.txt
------------------------------------------------------------------------
r1 | dweintraub | 2009-05-04 17:02:21 -0400 (Mon, 04 May 2009) | 2 lines

Adding file foo.txt

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

I then removed the third line:
$ cat foo.txt
this is line #1
this is line #2
$ svn commit -m"Removing third line"
Sending        foo.txt
Transmitting file data .
Committed revision 2.

Now, I decided I want to revert the change:

$ svn merge -rHEAD:1 foo.txt
--- Reverse-merging r2 into 'foo.txt':
U    foo.txt
$ svn commit -m"Reverting to revision 1"
Sending        foo.txt
Transmitting file data .
Committed revision 3.

Change reverted. What does my log show?

$ svn log -v foo.txt
------------------------------------------------------------------------
r3 | dweintraub | 2009-05-04 17:03:26 -0400 (Mon, 04 May 2009) | 1 line
Changed paths:
   M /foo.txt

Reverting to revision 1
------------------------------------------------------------------------
r2 | dweintraub | 2009-05-04 17:02:54 -0400 (Mon, 04 May 2009) | 1 line
Changed paths:
   M /foo.txt

Removing third line
------------------------------------------------------------------------
r1 | dweintraub | 2009-05-04 17:02:21 -0400 (Mon, 04 May 2009) | 2 lines
Changed paths:
   A /foo.txt

Adding file foo.txt

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


Why doesn't my log show the merge. It only shows the change and not
the fact I removed change #2 from my file.

The reason I am asking is we have a bit more complex version of this:
Someone commited a bunch of changed, someone else reverted the
changes, and then they merged changes from another branch.

I can't tell if they backed out the changes, or if they did a reverse
merge. I would think it is important for Subversion to know that
revision "X" was backed out of the file, and when you merge from a
branch, you shouldn't look at changes from revision "X".
$ cat foo.txt


-- 
David Weintraub
qazwart@gmail.com

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2060162

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].

RE: How does Undoing Change Show Up in History

Posted by "Todd C. Gleason" <tg...@impac.com>.
> > Why doesn't my log show the merge. It only shows the change and not
> > the fact I removed change #2 from my file.
> 
> r3 is the result of your merge. Svn doesn't know that when you commit
rev3
> it was the result of a merge command. You could have hand edited it
with
> the same change and commit it with the same result.
> 
> There is no way to know if a commit is due to a merge, hand edit,
applying
> a patch, applying a diff. They all look the same to svn.

Funny, I thought svn log -g would handle this, but as you said, it
doesn't.  It does handle a merge from a different location, but not a
reverse-merge in the same location.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2060364

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].


RE: How does Undoing Change Show Up in History

Posted by Bob Archer <Bo...@infor.com>.
> Change reverted. What does my log show?
> 
> $ svn log -v foo.txt
> ------------------------------------------------------------------------
> r3 | dweintraub | 2009-05-04 17:03:26 -0400 (Mon, 04 May 2009) | 1 line
> Changed paths:
>    M /foo.txt
> 
> Reverting to revision 1
> ------------------------------------------------------------------------
> r2 | dweintraub | 2009-05-04 17:02:54 -0400 (Mon, 04 May 2009) | 1 line
> Changed paths:
>    M /foo.txt
> 
> Removing third line
> ------------------------------------------------------------------------
> r1 | dweintraub | 2009-05-04 17:02:21 -0400 (Mon, 04 May 2009) | 2 lines
> Changed paths:
>    A /foo.txt
> 
> Adding file foo.txt
> 
> ------------------------------------------------------------------------
> 
> 
> Why doesn't my log show the merge. It only shows the change and not
> the fact I removed change #2 from my file.

r3 is the result of your merge. Svn doesn't know that when you commit rev3 it was the result of a merge command. You could have hand edited it with the same change and commit it with the same result. 

There is no way to know if a commit is due to a merge, hand edit, applying a patch, applying a diff. They all look the same to svn.

BOb

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2060247

To unsubscribe from this discussion, e-mail: [users-unsubscribe@subversion.tigris.org].