revert breaks hard links in the same tree
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
Commit does support hard links and keeps them, but when using revert the linking just vanishes.
This is what I did in detail. In the last diff you can see that the hard links disappeared.
fauli@sol /tmp/test $ touch test
fauli@sol /tmp/test $ ln test test.1
fauli@sol /tmp/test $ ln test test.2
fauli@sol /tmp/test $ ln test test.3
fauli@sol /tmp/test $ bzr init .
Created a standalone tree (format: 2a)
fauli@sol /tmp/test $ bzr add test*
adding test
adding test.1
adding test.2
adding test.3
fauli@sol /tmp/test $ bzr commit -m "Add"
Committing to: /tmp/test/
added test
added test.1
added test.2
added test.3
Committed revision 1.
fauli@sol /tmp/test $ bzr status
fauli@sol /tmp/test $ echo Test > test
fauli@sol /tmp/test $ bzr diff
=== modified file 'test'
--- test 2010-08-18 10:42:10 +0000
+++ test 2010-08-18 10:42:23 +0000
@@ -0,0 +1,1 @@
+Test
=== modified file 'test.1'
--- test.1 2010-08-18 10:42:10 +0000
+++ test.1 2010-08-18 10:42:23 +0000
@@ -0,0 +1,1 @@
+Test
=== modified file 'test.2'
--- test.2 2010-08-18 10:42:10 +0000
+++ test.2 2010-08-18 10:42:23 +0000
@@ -0,0 +1,1 @@
+Test
=== modified file 'test.3'
--- test.3 2010-08-18 10:42:10 +0000
+++ test.3 2010-08-18 10:42:23 +0000
@@ -0,0 +1,1 @@
+Test
fauli@sol /tmp/test $ bzr commit -m "Test"
Committing to: /tmp/test/
modified test
modified test.1
modified test.2
modified test.3
Committed revision 2.
fauli@sol /tmp/test $ echo Test >> test
fauli@sol /tmp/test $ bzr diff
=== modified file 'test'
--- test 2010-08-18 10:42:30 +0000
+++ test 2010-08-18 10:42:34 +0000
@@ -1,1 +1,2 @@
Test
+Test
=== modified file 'test.1'
--- test.1 2010-08-18 10:42:30 +0000
+++ test.1 2010-08-18 10:42:34 +0000
@@ -1,1 +1,2 @@
Test
+Test
=== modified file 'test.2'
--- test.2 2010-08-18 10:42:30 +0000
+++ test.2 2010-08-18 10:42:34 +0000
@@ -1,1 +1,2 @@
Test
+Test
=== modified file 'test.3'
--- test.3 2010-08-18 10:42:30 +0000
+++ test.3 2010-08-18 10:42:34 +0000
@@ -1,1 +1,2 @@
Test
+Test
fauli@sol /tmp/test $ bzr revert
M test
M test.1
M test.2
M test.3
fauli@sol /tmp/test $ echo Test >> test
fauli@sol /tmp/test $ bzr diff
=== modified file 'test'
--- test 2010-08-18 10:42:30 +0000
+++ test 2010-08-18 10:42:45 +0000
@@ -1,1 +1,2 @@
Test
+Test
$ bzr --version
Bazaar (bzr) 2.2.0
Python interpreter: /usr/bin/python2.6 2.6.5
Python standard library: /usr/lib/python2.6
Platform: Linux-2.
bzrlib: /usr/lib/
Bazaar configuration: /home/fauli/.bazaar
Bazaar log file: /home/fauli/
tags: | added: check-for-breezy |
This is a feature, in a few ways.
One is that we're as close to transactional as we can get on the
revert, which involves writing new files and renaming them into place.
Secondly, we create backup files in the most efficient way we know of
- we rename the existing file to the backup file name.
Lastly, w e don't disrupt other checkouts which are hardlinked
together (that can be create using branch --hardlink if I remember
correctly).
We could perhaps add an option for folk that don't want these guarantees.
-Rob