Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313134
hashtree.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
753 B
Subscribers
None
hashtree.py
View Options
#!/usr/bin/env python3
# Use sample:
# hashtree.py --path . --ignore '.svn' --ignore '.git-svn' \
# --ignore-empty-folders
# 38f8d2c3a951f6b94007896d0981077e48bbd702
import
click
from
swh.core
import
hashutil
from
swh.loader.svn.utils
import
hashtree
@click.command
()
@click.option
(
'--path'
,
default
=
'.'
,
help
=
'Optional path to hash.'
)
@click.option
(
'--ignore-empty-folder'
,
is_flag
=
True
,
default
=
False
,
help
=
'Ignore empty folder.'
)
@click.option
(
'--ignore'
,
multiple
=
True
,
help
=
'Ignore pattern.'
)
def
main
(
path
,
ignore_empty_folder
,
ignore
=
None
):
h
=
hashtree
(
path
,
ignore_empty_folder
,
ignore
)
if
h
:
print
(
hashutil
.
hash_to_hex
(
h
[
'sha1_git'
]))
if
__name__
==
'__main__'
:
main
()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Thu, Jul 3, 11:25 AM (1 w, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3393065
Attached To
rDLDSVN Subversion (SVN) loader
Event Timeline
Log In to Comment