revert does not preserve executable bit

Bug #74697 reported by John Dong
2
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Aaron Bentley

Bug Description

Revert doesn't care about the executable bit, and can even inadvertently strip it off.

TO REPRODUCE:
jdong@jdong-laptop:/tmp$ bzr init test
jdong@jdong-laptop:/tmp$ cd test
jdong@jdong-laptop:/tmp/test$ echo a > a
jdong@jdong-laptop:/tmp/test$ chmod +x a
jdong@jdong-laptop:/tmp/test$ bzr add && bzr ci -m a
added a
added a
Committed revision 1.
jdong@jdong-laptop:/tmp/test$ ls -l a
-rwxr-xr-x 1 jdong jdong 2 2006-12-06 15:32 a
jdong@jdong-laptop:/tmp/test$

So, a branch with a single file (executable) named a. Now, here's where the bug takes place:

jdong@jdong-laptop:/tmp/test$ echo b > a
jdong@jdong-laptop:/tmp/test$ ls -l a
-rwxr-xr-x 1 jdong jdong 2 2006-12-06 15:33 a
jdong@jdong-laptop:/tmp/test$ bzr st
modified:
  a
jdong@jdong-laptop:/tmp/test$ bzr revert
jdong@jdong-laptop:/tmp/test$ ls -al
total 20
drwxr-xr-x 3 jdong jdong 4096 2006-12-06 15:34 .
drwxrwxrwt 11 root root 4096 2006-12-06 15:32 ..
-rw-r--r-- 1 jdong jdong 2 2006-12-06 15:34 a
-rwxr-xr-x 1 jdong jdong 2 2006-12-06 15:33 a.~1~
drwxr-xr-x 6 jdong jdong 4096 2006-12-06 15:32 .bzr
jdong@jdong-laptop:/tmp/test$ bzr st
modified:
  a*
jdong@jdong-laptop:/tmp/test$ bzr revert
jdong@jdong-laptop:/tmp/test$ bzr st
modified:
  a*

After changing a then running a revert, the executable bit disappears from a. Further reverts do not fix it.

Revision history for this message
John Dong (jdong) wrote :

This is on Linux with the latest bzr.dev, btw.

Revision history for this message
John A Meinel (jameinel) wrote :

I can also confirm that doing:
$ echo a > a; chmod +x a
$ bzr add ; bzr commit -m a
$ chmod -x a
$ bzr status
modified:
  a*

$ bzr revert
$ bzr status
modified:
  a*

So if the only change is the executable bit, 'bzr revert' isn't fixing it.

Changed in bzr:
importance: Undecided → High
status: Unconfirmed → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

Aaron introduced and fixed the bug in bzr.dev post bzr 0.13

Changed in bzr:
assignee: nobody → aaron-bentley
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.