Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F16924744
latest_change.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
560 B
Subscribers
None
latest_change.py
View Options
#!/usr/bin/python
# Example printing the last author of a specified file
import
sys
import
time
from
dulwich.repo
import
Repo
if
len
(
sys
.
argv
)
<
2
:
print
(
"usage:
%s
filename"
%
(
sys
.
argv
[
0
],
))
sys
.
exit
(
1
)
r
=
Repo
(
"."
)
path
=
sys
.
argv
[
1
]
.
encode
(
'utf-8'
)
w
=
r
.
get_walker
(
paths
=
[
path
],
max_entries
=
1
)
try
:
c
=
next
(
iter
(
w
))
.
commit
except
StopIteration
:
print
(
"No file
%s
anywhere in history."
%
sys
.
argv
[
1
])
else
:
print
(
"
%s
was last changed by
%s
at
%s
(commit
%s
)"
%
(
sys
.
argv
[
1
],
c
.
author
,
time
.
ctime
(
c
.
author_time
),
c
.
id
))
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Sat, Mar 21, 3:47 PM (5 d, 9 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3397594
Attached To
rPPDW python3-dulwich packaging
Event Timeline
Log In to Comment