0

Is there a way to move a large number of files in a Fossil repo?

Ideally, I'd be able to move them to a new directory, and Fossil would detect that and keep tracking them. fossil mv requires specifying the filenames individually. fossil add can be used to start tracking the files once they've been moved, but then I have to use fossil rm to delete the existing files one at a time. Neither of these is practical for more than a handful of files.

user2225804
  • 761
  • 8
  • 22

2 Answers2

1

Fossil mv can take a directory as argument and it will move every files inside recursively. But the semantic is not exactly like the unix "mv" command and it doesn't works with the "--hard" option (probably a bug).

Example, if you have a directory "dir" and want to move it inside a new directory "subdir", this will works.

$ mkdir subdir
$ mv dir subdir/
$ fossil mv dir subdir/dir

   note: You have to use "subdir/dir" for the destination argument. Otherwise it will not do what you what, it will move all files that is inside dir directly in subdir. (so it doesn't use the same semantic as the unix "mv" command).

mgagnon
  • 314
  • 1
  • 4
  • 10
  • That will work if the goal is to move a full directory. However, in my case, I only need to move a subset of the files, and there may be no easy way to specify which ones in the call to `mv`. `addremove` does what I need conveniently. – user2225804 Jun 08 '18 at 22:36
0

fossil addremove does this. It's the equivalent of fossil add . to add all new files, followed by fossil rm for each missing file.

Moving files is only one use for this command. You can also use it if you've deleted multiple files.

The downside is that moved files will be treated as new files, so you will have to keep that in mind when viewing the repo history.

user2225804
  • 761
  • 8
  • 22