Patch to Add "Move" Functionality to Web Interface #1579
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1579
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I made a patch to add a move button to the directory listing of the web interface. It's used to move a file/dir inside a dir to a different dir contained in that dir. I have not written unit tests yet but they should be ready in a few days. This patch applies cleanly to both the 1.9.0 release (use patch -p1) and to the latest git (5fc99788269c350479b6ac51009d2725035ce0c5).
I have tested it in practical usage and found it to work quite well and handle errors gracefully.
Possible future improvements include the ability to move to a dircap URI outside of the current directory, but I will have to figure out how to convert a URI into a working DirectoryNode in a deferrer-friendly way before I can do this.
EDIT: Looks like I can't get the upload file thing to work. Here's a pastebin of the patch.
Added unit tests. Updated patch is here. Currently working on arbitrary URI targets and copy-only (an option to skip deleting the original link).
Finished arbitrary URI targets and unit tests for that feature. Updated patch. Decided to nix copy-only due to code complexity and lack of usefulness. Thanks for #tahoe-lafs for helping me out when I got suck! I'm done for now.
Wrote documentation for the new webapi function and stuck it in docs/frontends/webapi.rst. Patch
Attachment movebutton.diff (20607 bytes) added
"Final" complete patch including tests, docs, and the actual code.
The latest version of this patch should be looked for at the git branch.
Assigning to ChosenOne for review.
I am now reviewing this ticket.
I have reviewed this patch. It adds a 'move' operation to the Directory web view.
The move operation (dirnode.py) is a symlink followed a copy followed (on success) by an unlink, so the only possible race condition would result in two instances of the file. This behavior seems safe and isn't at all specific to the web interface anyway.
Straightforward tests are provided for all of the failure cases (except the interrupted-move described above, which is OK).
Minor note: a meme was applied incorrectly for the name of a nonexistent directory - 'notchucktesta' should be 'nopechecktesta'
In changeset:b29d0920d380c066:
I just landed this in changeset:841757, along with a few improvements. The only user-visible one was to merge the "move" page with the existing "rename" page, putting both forms next to each other, and changing the wording/layout to make it more clear what's getting moved where.
We might want to change the API before releasing this feature.. I've opened #1732 about it.