Commit graph

68 commits

Author SHA1 Message Date
Joey Hess
6a6ea06cee rename 2011-10-05 16:02:51 -04:00
Joey Hess
cfe21e85e7 rename 2011-10-04 00:59:08 -04:00
Joey Hess
8ef2095fa0 factor out common imports
no code changes
2011-10-03 23:29:48 -04:00
Joey Hess
f77979b8b5 improved git-annex branch changing
All changes to files in the branch are now made via pure functions that
transform the old file into the new. This will allow adding locking
to prevent read/write races. It also makes the code nicer, and purer.

I noticed a behavior change, really a sort of bug fix. Before,
'git annex untrust foo --trust bar' would change both trust levels
permanantly, now the --trust doesn't get stored.
2011-10-03 15:41:25 -04:00
Joey Hess
1c9c9a0cee golfing 2011-09-28 02:35:23 -04:00
Joey Hess
678726c10c code simplification thanks to applicative functors 2011-08-25 01:27:19 -04:00
Joey Hess
e784757376 hlint tweaks
Did all sources except Remotes/* and Command/*
2011-07-15 03:12:05 -04:00
Joey Hess
2640ee820f cleanup 2011-07-07 20:59:05 -04:00
Joey Hess
2fb771f135 Bugfix: Forgot to de-escape keys when upgrading.
Could result in bad location log data for keys that contain [&:%] in their
names. (A workaround for this problem is to run git annex fsck.)

`git annex unused --from remote` could also run into the broken code.
2011-07-07 17:04:21 -04:00
Joey Hess
9f1577f746 remove unused backend machinery
The only remaining vestiage of backends is different types of keys. These
are still called "backends", mostly to avoid needing to change user interface
and configuration. But everything to do with storing keys in different
backends was gone; instead different types of remotes are used.

In the refactoring, lots of code was moved out of odd corners like
Backend.File, to closer to where it's used, like Command.Drop and
Command.Fsck. Quite a lot of dead code was removed. Several data structures
became simpler, which may result in better runtime efficiency. There should
be no user-visible changes.
2011-07-05 19:57:46 -04:00
Joey Hess
79016c197c add hashing to web log files 2011-07-01 17:23:01 -04:00
Joey Hess
6bddebdb79 add the addurl command 2011-07-01 17:15:46 -04:00
Joey Hess
cdbcd6f495 add web special remote
Generalized LocationLog to PresenceLog, and use a presence log to record
urls for the web special remote.
2011-07-01 15:30:42 -04:00
Joey Hess
f6063a094e renamed GitRepo to Git
It was always imported qualified as Git anyway
2011-06-30 13:21:39 -04:00
Joey Hess
5034d8c298 Modify location log parser to allow future expansion.
Since the logs have just been moved into the git-annex branch, don't need
to worry about backwards compatability with old versions of git-annex that
would fail to parse location logs with extra fields tacked on.
2011-06-28 16:15:50 -04:00
Joey Hess
aad73c5721 rewrite loggedkeys to use git-annex branch
That sucking sound is a whole page of code vanishing to be replaced with
  return . catMaybes . map (logFileKey . takeFileName) =<< Branch.files
What can I say, git is my database, and haskell my copilot.
2011-06-22 23:24:14 -04:00
Joey Hess
1870186632 fixed logFile 2011-06-22 16:17:16 -04:00
Joey Hess
2e5c8ca6bf use git-annex branch for location log 2011-06-22 16:01:32 -04:00
Joey Hess
d3f0106f2e move LocationLog into Annex monad from IO
It will need to run in Annex so it can use Branch
2011-06-22 14:27:50 -04:00
Joey Hess
6aab88fa25 more monadic operator use 2011-05-15 15:27:49 -04:00
Joey Hess
cad0e1c8b7 simplified a bunch of Maybe handling 2011-05-15 03:38:08 -04:00
Joey Hess
09a16176de read log files strictly
This avoids leaking fds when an operation needs to read a lot of log files,
as unused will.
2011-04-02 20:36:01 -04:00
Joey Hess
f005a84e56 add loggedKeys 2011-04-02 15:50:51 -04:00
Joey Hess
616e6f8a84 Use lowercase hash directories for locationlog files
to avoid some issues with git on OSX with the mixed-case directories. No
migration is needed; the old mixed case hash directories are still read;
new information is written to the new directories.
2011-04-02 13:49:03 -04:00
Joey Hess
6ab63c438d not really a bug
This can occur if a local remote repo has not been initted, so has no uuid
yet.
2011-04-01 21:24:06 -04:00
Joey Hess
5eb76d2b03 improve upgrade 2011-03-16 11:53:46 -04:00
Joey Hess
dd5448eb07 added 2 level hashing
This means there can be 1024 subdirs, each with up to 1024 sub-subdirs.
So with hundreds of millions of annexed objects, each leaf directory will
have only a few files on average.
2011-03-15 23:58:27 -04:00
Joey Hess
6d3df8a083 more pure code refactoring 2011-01-29 23:56:40 -04:00
Joey Hess
04fe906ac6 use safewritefile 2011-01-28 12:35:51 -04:00
Joey Hess
a8ce30401d add checks that location log files are committed
currently failing for move --to
2011-01-11 16:00:40 -04:00
Joey Hess
500ddd7f4b add a check for unknown UUID when logging 2011-01-04 17:03:29 -04:00
Joey Hess
52ec6e748d do not need to use Git.relative here (it is a no-op in this case anyway) 2010-11-28 16:31:20 -04:00
Joey Hess
57adb0347b hlint tweaks
Remotes.hs next, and also Backend/* and Command/*
2010-11-22 15:46:57 -04:00
Joey Hess
a51b364a35 trim exports 2010-11-15 13:00:43 -04:00
Joey Hess
b2c28c1ac0 more Wall cleaning 2010-10-31 15:50:07 -04:00
Joey Hess
59672d32ed write to tmp file
Writing to a tmp file means no locking is needed, and it fixes a bug
introduced by the last commit, which made log files be read lazily, so
they could still be open when written, which breaks due to haskell's
internal locking.
2010-10-31 01:06:58 -04:00
Joey Hess
d5a0c16298 more space saving by not locking location log for read
Actions that need to read all the location logs, like "git annex get .",
were still using a lot of memory, and profiling pointed at the location log
reading as the problem. Not locking them for read, and thus avoiding the
strict reading fixes the problem, although I don't quite understand why.
(Oddly, -sstderr profiling did not show the memory as used, though top
showed dozens of MB being used.)

Anyway, it's fine to not lock location logs for read, since the log format
and parser should be safe if a partial read of a file being written happens.
Note that that could easily happen anyway, if doing a git pull, etc,
especially if git needs to union merge in changes from elsewhere. The worst
that will happen is git-annex could get a bad or out of date idea about
locations and refuse to eg, --drop something.
2010-10-30 23:34:40 -04:00
Joey Hess
694a33e91b syntax tweaks 2010-10-28 14:20:02 -04:00
Joey Hess
833d4b342e copyright statements 2010-10-27 16:53:54 -04:00
Joey Hess
24ee4439d4 use git command queue 2010-10-26 16:15:29 -04:00
Joey Hess
1aa19422ac git annex move --from remote almost working 2010-10-25 17:17:03 -04:00
Joey Hess
4b1086cc7d experimentally, removing all actual git committing
Idea is the user will commit when ready, just stage everything.
2010-10-18 01:52:06 -04:00
Joey Hess
a4dc920f6b remove some old todos 2010-10-17 16:44:06 -04:00
Joey Hess
909f619c07 tweaks 2010-10-16 16:20:49 -04:00
Joey Hess
6f3572e47f more reorg, spiffed up state monad 2010-10-14 03:18:11 -04:00
Joey Hess
48643b68b3 convert GitRepo to qualified import 2010-10-14 02:36:41 -04:00
Joey Hess
eda80e44c5 add module that only exports abstract types 2010-10-14 02:12:41 -04:00
Joey Hess
e28ff5bdaf almost able to get files from remotes now! 2010-10-13 15:55:18 -04:00
Joey Hess
b7858ada03 bugfixes 2010-10-12 20:04:36 -04:00
Joey Hess
476f66abb9 now that a uuid is used, don't need to rejoin 2010-10-12 18:31:02 -04:00