Merge lp:~jelmer/brz/path2ie-more into lp:brz

Proposed by Jelmer Vernooij on 2018-09-17
Status: Merged
Approved by: Jelmer Vernooij on 2018-09-22
Approved revision: 6941
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/path2ie-more
Merge into: lp:brz
Diff against target: 42 lines (+6/-9)
1 file modified
breezy/bzr/workingtree.py (+6/-9)
To merge this branch: bzr merge lp:~jelmer/brz/path2ie-more
Reviewer Review Type Date Requested Status
Martin Packman 2018-09-17 Approve on 2018-09-21
Review via email: mp+355138@code.launchpad.net

Commit message

Use _path2ie in a couple more places.

Description of the change

Use _path2ie in a couple more places.

To post a comment you must log in.
Martin Packman (gz) wrote :

Thanks, looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/bzr/workingtree.py'
2--- breezy/bzr/workingtree.py 2018-09-14 14:35:18 +0000
3+++ breezy/bzr/workingtree.py 2018-09-17 13:35:59 +0000
4@@ -731,12 +731,12 @@
5 raise
6
7 def _is_executable_from_path_and_stat_from_basis(self, path, stat_result):
8- inv, file_id = self._path2inv_file_id(path)
9- if file_id is None:
10+ try:
11+ return self._path2ie(path).executable
12+ except errors.NoSuchFile:
13 # For unversioned files on win32, we just assume they are not
14 # executable
15 return False
16- return inv.get_entry(file_id).executable
17
18 def _is_executable_from_path_and_stat_from_stat(self, path, stat_result):
19 mode = stat_result.st_mode
20@@ -744,8 +744,8 @@
21
22 def is_executable(self, path, file_id=None):
23 if not self._supports_executable():
24- inv, inv_file_id = self._path2inv_file_id(path)
25- return inv.get_entry(inv_file_id).executable
26+ ie = self._path2ie(path)
27+ return ie.executable
28 else:
29 mode = os.lstat(self.abspath(path)).st_mode
30 return bool(stat.S_ISREG(mode) and stat.S_IEXEC & mode)
31@@ -1455,10 +1455,7 @@
32
33 def stored_kind(self, path, file_id=None):
34 """See Tree.stored_kind"""
35- inv, inv_file_id = self._path2inv_file_id(path)
36- if inv_file_id is None:
37- raise errors.NoSuchFile(self, path)
38- return inv.get_entry(inv_file_id).kind
39+ return self._path2ie(path).kind
40
41 def extras(self):
42 """Yield all unversioned files in this WorkingTree.

Subscribers

People subscribed via source and target branches