Merge lp:~parthm/bzr/262450 into lp:bzr
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Martin Pool on 2010-03-11 | ||||
| Approved revision: | 5045 | ||||
| Merged at revision: | not available | ||||
| Proposed branch: | lp:~parthm/bzr/262450 | ||||
| Merge into: | lp:bzr | ||||
| Diff against target: |
124 lines (+50/-3) 5 files modified
NEWS (+4/-0) bzrlib/bzrdir.py (+0/-2) bzrlib/tests/blackbox/test_upgrade.py (+14/-0) bzrlib/tests/features.py (+26/-0) bzrlib/transport/__init__.py (+6/-1) |
||||
| To merge this branch: | bzr merge lp:~parthm/bzr/262450 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Vincent Ladeuil | Needs Fixing on 2010-03-03 | ||
| Martin Pool | 2010-02-17 | Approve on 2010-02-18 | |
|
Review via email:
|
|||
This proposal supersedes a proposal from 2010-02-16.
Commit Message
(mbp, for parthm) check permissions on .bzr are copied to backup.bzr
| Parth Malwankar (parthm) wrote : | # |
| Parth Malwankar (parthm) wrote : | # |
Just wanted to add that I haven't tested this on windows as
I don't have access to a windows machine.
| Martin Pool (mbp) wrote : | # |
On 17 February 2010 01:05, Parth Malwankar <email address hidden> wrote:
> Just wanted to add that I haven't tested this on windows as
> I don't have access to a windows machine.
Thanks for noting that.
You can fairly easily set up python to run under Wine on Linux (I
posted or added docs about this before) and then do
winepython ./bzr selftest ...
and it's pretty good at testing this kind of thing.
--
Martin <http://
| Martin Pool (mbp) wrote : | # |
So probably the permissions stuff just can't work like this on Windows, in which case we should probably:
1- make that test requireFeature something unixy; probably it would be good to declare a new Feature for unix permissions and just say it exists if os.platform=posix
2- check the actual runtime code passes on windows (even if it does nothing)
3- file a followon bug about inheriting acls on windows
| Martin Pool (mbp) wrote : | # |
This does indeed fail under WinePython.
------------
Traceback (most recent call last):
File "Z:\home\
return fn(*args)
File "Z:\home\
testMethod()
File "Z:\home\
self.
AssertionError
------------
This will probably clash with your other patch to use numbered backups.
Also just a note for the future, if you want you can do bugfixes based off and proposed back into bzr.2.0. This kind of thing would be good to put into the stable release; indeed it might be worth backporting from your branch.
Let me know if you want a hand with adding the feature stuff to skip on windows.
| Parth Malwankar (parthm) wrote : | # |
Based on Martins comments:
>So probably the permissions stuff just can't work like this on Windows, in which case we should probably:
> 1- make that test requireFeature something unixy; probably it would be good to declare a new Feature for unix permissions and just say it exists if os.platform=posix
Added PosixOSFeature and the permissions test case now requireFeatures this.
> 2- check the actual runtime code passes on windows (even if it does nothing)
Ran tests on Window. It would be good if someone could verify this again.
> 3- file a followon bug about inheriting acls on windows
Filed bug #523187 for Windows
| Parth Malwankar (parthm) wrote : | # |
Not sure it resubmit of the proposal was the right thing to do as the comments remain with the previous proposal. Oh well.
Martin said:
> This will probably clash with your other patch to use numbered backups.
Yes. Depending on the order in which they land I could look into updating it. It should be minor as only backup_dir needs to be updated in one place in the test case.
>Also just a note for the future, if you want you can do bugfixes based off and proposed back into bzr.2.0. This kind of thing would be good to put into the stable release; indeed it might be worth backporting from your branch.
Makes sense. I will look into backporting this fix.
Do we just want to port the permissions fix or should I also look into porting the numbered backup.bzr naming fix?
- 5041. By Parth Malwankar on 2010-02-17
-
minor: replaced hardcoded string with backup_dir
| Martin Pool (mbp) wrote : | # |
On 18 February 2010 00:18, Parth Malwankar <email address hidden> wrote:
> Based on Martins comments:
>
>>So probably the permissions stuff just can't work like this on Windows, in which case we should probably:
>> 1- make that test requireFeature something unixy; probably it would be good to declare a new Feature for unix permissions and just say it exists if os.platform=posix
>
> Added PosixOSFeature and the permissions test case now requireFeatures this.
I think, to be a bit pedantic, the actual check is for unix
permissions; this could conceivably pass under cygwin and fail on unix
with a vfat filesystem.
>> 2- check the actual runtime code passes on windows (even if it does nothing)
>
> Ran tests on Window. It would be good if someone could verify this again.
I'll check
>> 3- file a followon bug about inheriting acls on windows
>
> Filed bug #523187 for Windows
thanks
--
Martin <http://
| Martin Pool (mbp) wrote : | # |
On 18 February 2010 00:27, Parth Malwankar <email address hidden> wrote:
> Not sure it resubmit of the proposal was the right thing to do as the comments remain with the previous proposal. Oh well.
Generally you don't need to resubmit, just push to your branch.
>
> Martin said:
>
>> This will probably clash with your other patch to use numbered backups.
>
> Yes. Depending on the order in which they land I could look into updating it. It should be minor as only backup_dir needs to be updated in one place in the test case.
>
>>Also just a note for the future, if you want you can do bugfixes based off and proposed back into bzr.2.0. This kind of thing would be good to put into the stable release; indeed it might be worth backporting from your branch.
>
> Makes sense. I will look into backporting this fix.
> Do we just want to port the permissions fix or should I also look into porting the numbered backup.bzr naming fix?
Well, they're both bug fixes, but I would say that the permissions one
is more clearly just a bug fix, whereas the numbering one introduces
more of a permissions change. So I would backport only the first.
--
Martin <http://
- 5042. By Parth Malwankar on 2010-02-18
-
changed PosixOSFeature to PosixPermission
sFeature which is more
specific as cygwin may appear as posix without the permissions support.
| Parth Malwankar (parthm) wrote : | # |
> On 18 February 2010 00:18, Parth Malwankar <email address hidden> wrote:
> > Based on Martins comments:
> >
> >>So probably the permissions stuff just can't work like this on Windows, in
> which case we should probably:
> >> 1- make that test requireFeature something unixy; probably it would be good
> to declare a new Feature for unix permissions and just say it exists if
> os.platform=posix
> >
> > Added PosixOSFeature and the permissions test case now requireFeatures this.
>
> I think, to be a bit pedantic, the actual check is for unix
> permissions; this could conceivably pass under cygwin and fail on unix
> with a vfat filesystem.
>
Added feature PosixPermission
permissions support (by create-change perms-verify perms sequence) if
os.name is posix.
Tests are passing on Windows (a borrowed system) and Linux. Windows skips the
test as expected.
Haven't been able to verify on Cygwin or OSX and I don't have those systems.
Removed PosixOSFeature added earlier.
--
Parth
| Martin Pool (mbp) wrote : | # |
lovely.
I might move the new feature into features.py and mention it in the testing guide as I merge it.
| Martin Pool (mbp) wrote : | # |
backport to 2.0 sent to pqm
| Martin Pool (mbp) wrote : | # |
this fails with
^^^^[log from bzrlib.
-------
Traceback (most recent call last):
File "/home/
transport.
File "/home/
source.
File "/home/
to_transport
File "/home/
unknown_
File "/home/
raise unknown_exc(path, extra=extra)
FileExists: File exists: '/to/dir': 550 error creating directory: Permission denied
Parth, let me know if you want help with it.
- 5043. By Parth Malwankar on 2010-02-18
-
updated to use only rwx permission bits during copy.
| Parth Malwankar (parthm) wrote : | # |
> this fails with
>
> ^^^^[log from
> bzrlib.
> -------
> Traceback (most recent call last):
> File "/home/
> 1442, in test_copy_tree
> transport.
> File "/home/
> 1063, in copy_tree
> source.
> File "/home/
> 1077, in copy_tree_
> to_transport.
> File "/home/
> line 362, in mkdir
> unknown_
> File "/home/
> line 200, in _translate_
> raise unknown_exc(path, extra=extra)
> FileExists: File exists: '/to/dir': 550 error creating directory: Permission
> denied
>
>
> Parth, let me know if you want help with it.
Fixed.
copy_tree updated to consider only rwx bits during copy i.e. target.mkdir('.', stat.st_mode & 0777)
| Vincent Ladeuil (vila) wrote : | # |
15 +* ``bzr upgrade`` now creates the ``backup.bzr`` directory with the same
Sorts before:
9 * ``bzr upgrade`` now names backup directory as ``backup.bzr.~N~`` instead
that should address the conflict.
45 +class _PosixPermissio
I think we put new features into bzrlib.
88 + import os, stat
Generally, for tests, we put imports at the top of the file.
109 + stat = self.stat(
110 + target.mkdir('.', stat.st_mode & 0777)
A comment would not hurt :)
- 5044. By Parth Malwankar on 2010-03-03
-
closed review comments from vila
- 5045. By Parth Malwankar on 2010-03-03
-
merged trunk. resolved conflict in NEWS.
| Parth Malwankar (parthm) wrote : | # |
> 15 +* ``bzr upgrade`` now creates the ``backup.bzr`` directory with the
> same
>
> Sorts before:
>
> 9 * ``bzr upgrade`` now names backup directory as ``backup.bzr.~N~``
> instead
>
> that should address the conflict.
>
Fixed. I merged the trunk and resolved this.
> 45 +class _PosixPermissio
>
> I think we put new features into bzrlib.
>
> 88 + import os, stat
>
> Generally, for tests, we put imports at the top of the file.
>
> 109 + stat = self.stat(
> 110 + target.mkdir('.', stat.st_mode & 0777)
>
> A comment would not hurt :)
Done.
Thanks for the review comments Vincent.
| Martin Pool (mbp) wrote : | # |
| Martin Pool (mbp) wrote : | # |
This fails in pqm in a blackbox.
Traceback (most recent call last):
File "/usr/lib/
return fn(*args)
File "/usr/lib/
testMethod()
File "/home/
new_perms = os.stat(
OSError: [Errno 2] No such file or directory: 'backup.bzr'
------------
- 5046. By Parth Malwankar on 2010-03-17
-
merged in trunk. fixed blackbox.
test_upgrade to use backup.bzr.~N~ convention.
| Parth Malwankar (parthm) wrote : | # |
> OSError: [Errno 2] No such file or directory: 'backup.bzr'
> ------------
Fixed.
| Martin Pool (mbp) wrote : | # |

Fix for #262450.
To ensure that permissions for .bzr are copied to backup.bzr,
we do a stat on .bzr and pass the mode bits to target.mkdir.
Test modifies permissions for .bzr to be 0700 and ensures that
the permissions for backup.bzr are 0700 after upgrade.