Commit graph

117 commits

Author SHA1 Message Date
Joey Hess
f86462b475 allow lazy reading of map contents
Don't explicitly close; hGetContents will close when read is done.
2013-01-18 13:16:16 -04:00
Joey Hess
5c58e9c101 Avoid filename encoding errors when writing direct mode mappings. 2013-01-18 12:26:45 -04:00
Joey Hess
bbf0e74f72 Fix direct mode mapping code to always store direct mode filenames relative to the top of the repository, even when operating inside a subdirectory. 2013-01-18 12:20:08 -04:00
Joey Hess
2fdefc656b fix logic error breaking direct mode assistant autocommit of modified files 2012-12-28 16:00:19 -04:00
Joey Hess
eb40227d15 assistant direct mode file add/change bookkeeping
When a file is changed in direct mode, the old content is probably lost
(at least from the local repo), and bookeeping needs to be updated to
reflect this.

Also, synthetic add events are generated at assistant startup, so
make it detect when the file has not really changed, and avoid re-adding
it.

This does add the overhead of querying the runing git cat-file for the
key that's recorded in git for the file, each time a file is added or
modified in direct mode.
2012-12-25 15:48:15 -04:00
Joey Hess
ddb0adb998 more quickcheck fun 2012-12-19 16:36:19 -04:00
Joey Hess
97d670b0d5 normalise associated files
Sometimes ./file will be passed in, and sometimes file; need to treat these
the same.
2012-12-19 12:44:24 -04:00
Joey Hess
53dbcce645 direct mode merging works!
Automatic merge resoltion code needs to be fixed to preserve objects from
direct mode files.
2012-12-18 15:04:44 -04:00
Joey Hess
cfe354eccd whitespace fix 2012-12-13 00:46:30 -04:00
Joey Hess
e7b8cb0063 direct mode committing 2012-12-12 19:20:38 -04:00
Joey Hess
f2ed0f9659 fix associated files to not fall back to object location 2012-12-12 13:11:59 -04:00
Joey Hess
752b5354ab make parent directory 2012-12-12 13:05:50 -04:00
Joey Hess
9d133270c2 update 2012-12-10 15:02:44 -04:00
Joey Hess
514957914d direct mode mappings now updated by git annex sync
Still lots to do to make sync handle direct mode, but this is a good first
step.
2012-12-10 14:37:24 -04:00
Joey Hess
b4c6da9cbd Got object sending working in direct mode.
However, I don't yet have a reliable way to deal with files being modified
while they're being transferred. I have code that detects it on the sending
side, but the receiver is still free to move the wrong content into its
annex, and record that it has the content. So that's not acceptable, and
I'll need to work on it some more.

However, at this point I can use a direct mode repository as a remote and
transfer files from and to it.
2012-12-08 17:03:39 -04:00
Joey Hess
664765e757 update the cache automatically when moving objects in or out 2012-12-08 13:13:36 -04:00
Joey Hess
ef24751922 support for checking presence of objects in direct mode
Also for dropping objects in direct mode.

Checking presence reliably needs a cache of mtime, size, and inode.
This way, if a file is modified, keys that point to it are no longer
present.

Also, the code for restoring the symlink when removing objects is
unnecessarily messy. calcGitLink was generating links starting with
"../../remote/.git/", when running "git annex move --from remote".
I put in a workaround, but calcGitLink should probably be fixed.

There is not yet support for getting objects from repositories in direct
mode; it still looks for content in .git/annex/objects, and there's no
once place I can change to fix that.

Also, getting objects from direct mode repositories is problematic since
the can be changed while the object is being transferred. It probably needs
to quarantine it first.
2012-12-07 17:29:55 -04:00