darcs

Issue 2547 report total number of files asap when cloning repository pristine

Title report total number of files asap when cloning repository pristine
Priority Status given-up
Milestone Resolved in
Superseder Nosy List gh
Assigned To
Topics

Created on 2017-09-06.15:46:30 by gh, last changed 2024-06-28.22:18:28 by bfrk.

Messages
msg19646 (view) Author: gh Date: 2017-09-06.15:46:29
When cloning a repository, pristine copying is done by the function
Darcs.Repository.Hashed.copyHashed . This function reads the "root"
hashed file of the pristine, which describes its contents as a
directory. The contents are represented as a list which contains files
and directories. Then it processes this list. In the case of a file, it
copies it. In the case of a directory, it creates it and (recursively)
calls copyHashed on this directory.

Hence directories described by the remote pristine are traversed
depth-first and files and directories processing is mixed. Moreover the
amount of files grows during the progress report of cloning.

From the UI point of view, it would be better to know ASAP the total
amount of directories and files, and proceed copying files only when
their total amount is known. Then the progress report would look a
little more informative.

This can be done by reimplementing copyHashed in a breadth first way and
maintaining directories and files in separate queues.

One caveat is that copyHashed works by changing the current directory to
the one of the directory currently copied from the remote pristine.
Files are also copied in the same "local" way since hashed pristine
files only contain file names (without their paths).
msg24053 (view) Author: bfrk Date: 2024-06-28.22:18:28
This is obsolete. The function copyHashed was in Darcs.Repository.HashedIO 
which has been optimized out a few years ago. Pristine files are now handled 
in the same way as other hashed files are, i.e. using fetchFileUsingCache and 
friends, and these routines do not currently support progress reporting.
History
Date User Action Args
2017-09-06 15:46:30ghcreate
2024-06-28 22:18:28bfrksetstatus: unknown -> given-up
messages: + msg24053