git-annex 5.20150113 → 5.20150205
raw patch · 590 files changed
+2845/−1070 lines, 590 files
This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.
Files
- .mailmap +4/−3
- Annex.hs +1/−3
- Annex/AutoMerge.hs +2/−2
- Annex/Branch.hs +12/−1
- Annex/Branch/Transitions.hs +1/−1
- Annex/BranchState.hs +1/−1
- Annex/CatFile.hs +1/−1
- Annex/CheckAttr.hs +1/−1
- Annex/CheckIgnore.hs +1/−1
- Annex/Content.hs +6/−6
- Annex/Content/Direct.hs +4/−4
- Annex/Difference.hs +58/−0
- Annex/DirHashes.hs +86/−0
- Annex/Direct.hs +5/−5
- Annex/Direct/Fixup.hs +1/−1
- Annex/Drop.hs +1/−1
- Annex/Environment.hs +1/−1
- Annex/FileMatcher.hs +4/−4
- Annex/Hook.hs +7/−11
- Annex/Index.hs +1/−1
- Annex/Init.hs +4/−2
- Annex/Journal.hs +1/−1
- Annex/Link.hs +1/−1
- Annex/LockFile.hs +1/−1
- Annex/MakeRepo.hs +1/−1
- Annex/MetaData.hs +1/−1
- Annex/MetaData/StandardFields.hs +1/−1
- Annex/Notification.hs +1/−1
- Annex/Path.hs +1/−1
- Annex/Perms.hs +1/−1
- Annex/Queue.hs +1/−1
- Annex/Quvi.hs +1/−1
- Annex/ReplaceFile.hs +1/−1
- Annex/Ssh.hs +1/−1
- Annex/TaggedPush.hs +1/−1
- Annex/Transfer.hs +2/−3
- Annex/UUID.hs +1/−1
- Annex/Url.hs +1/−1
- Annex/VariantFile.hs +1/−1
- Annex/Version.hs +1/−1
- Annex/View.hs +2/−2
- Annex/View/ViewedFile.hs +1/−1
- Annex/Wanted.hs +5/−5
- Assistant.hs +1/−1
- Assistant/Alert.hs +1/−1
- Assistant/Alert/Utility.hs +1/−1
- Assistant/BranchChange.hs +1/−1
- Assistant/Changes.hs +1/−1
- Assistant/Commits.hs +1/−1
- Assistant/Common.hs +1/−1
- Assistant/CredPairCache.hs +1/−1
- Assistant/DaemonStatus.hs +1/−1
- Assistant/DeleteRemote.hs +1/−1
- Assistant/Drop.hs +1/−1
- Assistant/Fsck.hs +1/−1
- Assistant/Gpg.hs +1/−1
- Assistant/Install.hs +1/−1
- Assistant/Install/AutoStart.hs +1/−1
- Assistant/Install/Menu.hs +1/−1
- Assistant/MakeRemote.hs +1/−1
- Assistant/Monad.hs +1/−1
- Assistant/NamedThread.hs +1/−1
- Assistant/NetMessager.hs +1/−1
- Assistant/Pairing.hs +1/−1
- Assistant/Pairing/MakeRemote.hs +6/−7
- Assistant/Pairing/Network.hs +1/−1
- Assistant/Pushes.hs +1/−1
- Assistant/RemoteControl.hs +1/−1
- Assistant/Repair.hs +2/−3
- Assistant/RepoProblem.hs +1/−1
- Assistant/Restart.hs +2/−3
- Assistant/ScanRemotes.hs +1/−1
- Assistant/Ssh.hs +11/−19
- Assistant/Sync.hs +1/−1
- Assistant/Threads/Committer.hs +2/−2
- Assistant/Threads/ConfigMonitor.hs +1/−1
- Assistant/Threads/Cronner.hs +1/−1
- Assistant/Threads/DaemonStatus.hs +1/−1
- Assistant/Threads/Glacier.hs +1/−1
- Assistant/Threads/Merger.hs +1/−1
- Assistant/Threads/MountWatcher.hs +1/−1
- Assistant/Threads/NetWatcher.hs +1/−1
- Assistant/Threads/PairListener.hs +1/−1
- Assistant/Threads/ProblemFixer.hs +1/−1
- Assistant/Threads/Pusher.hs +1/−1
- Assistant/Threads/RemoteControl.hs +1/−1
- Assistant/Threads/SanityChecker.hs +3/−5
- Assistant/Threads/TransferPoller.hs +2/−3
- Assistant/Threads/TransferScanner.hs +1/−1
- Assistant/Threads/TransferWatcher.hs +1/−1
- Assistant/Threads/Transferrer.hs +1/−1
- Assistant/Threads/UpgradeWatcher.hs +1/−1
- Assistant/Threads/Upgrader.hs +1/−1
- Assistant/Threads/Watcher.hs +4/−4
- Assistant/Threads/WebApp.hs +1/−1
- Assistant/Threads/XMPPClient.hs +1/−1
- Assistant/Threads/XMPPPusher.hs +1/−1
- Assistant/TransferQueue.hs +1/−1
- Assistant/TransferSlots.hs +1/−1
- Assistant/TransferrerPool.hs +1/−1
- Assistant/Types/Alert.hs +1/−1
- Assistant/Types/BranchChange.hs +1/−1
- Assistant/Types/Buddies.hs +1/−1
- Assistant/Types/Changes.hs +1/−1
- Assistant/Types/Commits.hs +1/−1
- Assistant/Types/CredPairCache.hs +1/−1
- Assistant/Types/DaemonStatus.hs +1/−1
- Assistant/Types/NamedThread.hs +1/−1
- Assistant/Types/NetMessager.hs +1/−1
- Assistant/Types/Pushes.hs +1/−1
- Assistant/Types/RemoteControl.hs +1/−1
- Assistant/Types/RepoProblem.hs +1/−1
- Assistant/Types/ScanRemotes.hs +1/−1
- Assistant/Types/ThreadName.hs +1/−1
- Assistant/Types/ThreadedMonad.hs +1/−1
- Assistant/Types/TransferQueue.hs +1/−1
- Assistant/Types/TransferSlots.hs +1/−1
- Assistant/Types/TransferrerPool.hs +1/−1
- Assistant/Types/UrlRenderer.hs +1/−1
- Assistant/Unused.hs +1/−1
- Assistant/Upgrade.hs +1/−1
- Assistant/WebApp.hs +1/−1
- Assistant/WebApp/Common.hs +1/−1
- Assistant/WebApp/Configurators.hs +1/−1
- Assistant/WebApp/Configurators/AWS.hs +1/−1
- Assistant/WebApp/Configurators/Delete.hs +1/−1
- Assistant/WebApp/Configurators/Edit.hs +9/−9
- Assistant/WebApp/Configurators/Fsck.hs +3/−3
- Assistant/WebApp/Configurators/IA.hs +2/−2
- Assistant/WebApp/Configurators/Local.hs +1/−1
- Assistant/WebApp/Configurators/Pairing.hs +1/−1
- Assistant/WebApp/Configurators/Preferences.hs +7/−7
- Assistant/WebApp/Configurators/Ssh.hs +11/−11
- Assistant/WebApp/Configurators/Unused.hs +4/−4
- Assistant/WebApp/Configurators/Upgrade.hs +1/−1
- Assistant/WebApp/Configurators/WebDAV.hs +1/−1
- Assistant/WebApp/Configurators/XMPP.hs +3/−3
- Assistant/WebApp/Control.hs +1/−1
- Assistant/WebApp/DashBoard.hs +1/−1
- Assistant/WebApp/Documentation.hs +1/−1
- Assistant/WebApp/Form.hs +1/−1
- Assistant/WebApp/Gpg.hs +1/−1
- Assistant/WebApp/MakeRemote.hs +1/−1
- Assistant/WebApp/Notifications.hs +1/−1
- Assistant/WebApp/OtherRepos.hs +1/−1
- Assistant/WebApp/Page.hs +1/−1
- Assistant/WebApp/Repair.hs +1/−1
- Assistant/WebApp/RepoId.hs +1/−1
- Assistant/WebApp/RepoList.hs +1/−1
- Assistant/WebApp/SideBar.hs +1/−1
- Assistant/WebApp/Types.hs +1/−1
- Assistant/XMPP.hs +1/−1
- Assistant/XMPP/Buddies.hs +1/−1
- Assistant/XMPP/Client.hs +1/−1
- Assistant/XMPP/Git.hs +1/−1
- Backend.hs +1/−1
- Backend/Hash.hs +10/−11
- Backend/URL.hs +1/−1
- Backend/Utilities.hs +1/−1
- Backend/WORM.hs +5/−3
- Build/BundledPrograms.hs +1/−1
- Build/Configure.hs +3/−1
- Build/DesktopFile.hs +1/−1
- Build/DistributionUpdate.hs +16/−13
- Build/EvilLinker.hs +1/−1
- Build/EvilSplicer.hs +1/−1
- Build/InstallDesktopFile.hs +1/−1
- Build/LinuxMkLibs.hs +1/−1
- Build/NullSoftInstaller.hs +22/−4
- Build/OSXMkLibs.hs +1/−1
- Build/Standalone.hs +1/−1
- BuildFlags.hs +1/−6
- CHANGELOG +37/−0
- COPYRIGHT +9/−9
- Checks.hs +1/−1
- CmdLine.hs +1/−1
- CmdLine/Action.hs +1/−1
- CmdLine/GitAnnex.hs +1/−1
- CmdLine/GitAnnex/Options.hs +1/−1
- CmdLine/GitAnnexShell.hs +1/−1
- CmdLine/GitAnnexShell/Fields.hs +1/−1
- CmdLine/Option.hs +1/−1
- CmdLine/Seek.hs +1/−1
- CmdLine/Usage.hs +1/−1
- Command.hs +1/−1
- Command/Add.hs +6/−5
- Command/AddUnused.hs +1/−1
- Command/AddUrl.hs +53/−49
- Command/Assistant.hs +1/−1
- Command/Commit.hs +1/−1
- Command/ConfigList.hs +1/−1
- Command/Copy.hs +1/−1
- Command/Dead.hs +1/−1
- Command/Describe.hs +1/−1
- Command/DiffDriver.hs +1/−1
- Command/Direct.hs +1/−1
- Command/Drop.hs +2/−2
- Command/DropKey.hs +1/−1
- Command/DropUnused.hs +1/−1
- Command/EnableRemote.hs +1/−1
- Command/ExamineKey.hs +1/−1
- Command/Find.hs +4/−3
- Command/FindRef.hs +1/−1
- Command/Fix.hs +2/−2
- Command/Forget.hs +1/−1
- Command/FromKey.hs +2/−2
- Command/Fsck.hs +3/−4
- Command/FuzzTest.hs +1/−1
- Command/GCryptSetup.hs +1/−1
- Command/Get.hs +2/−2
- Command/Group.hs +1/−1
- Command/Help.hs +1/−1
- Command/Import.hs +1/−1
- Command/ImportFeed.hs +4/−2
- Command/InAnnex.hs +1/−1
- Command/Indirect.hs +2/−2
- Command/Info.hs +48/−11
- Command/Init.hs +1/−1
- Command/InitRemote.hs +1/−1
- Command/List.hs +1/−1
- Command/Lock.hs +1/−1
- Command/Log.hs +3/−2
- Command/LookupKey.hs +1/−1
- Command/Map.hs +1/−1
- Command/Merge.hs +1/−1
- Command/MetaData.hs +1/−1
- Command/Migrate.hs +1/−1
- Command/Mirror.hs +1/−1
- Command/Move.hs +1/−1
- Command/NotifyChanges.hs +1/−1
- Command/NumCopies.hs +1/−1
- Command/PreCommit.hs +1/−1
- Command/Proxy.hs +1/−1
- Command/ReKey.hs +1/−1
- Command/RecvKey.hs +2/−3
- Command/Reinit.hs +1/−1
- Command/Reinject.hs +1/−1
- Command/RemoteDaemon.hs +1/−1
- Command/Repair.hs +1/−1
- Command/ResolveMerge.hs +1/−1
- Command/RmUrl.hs +1/−1
- Command/Schedule.hs +1/−1
- Command/Semitrust.hs +1/−1
- Command/SendKey.hs +1/−1
- Command/SetPresentKey.hs +1/−1
- Command/Status.hs +2/−2
- Command/Sync.hs +10/−4
- Command/Test.hs +1/−1
- Command/TestRemote.hs +1/−1
- Command/TransferInfo.hs +1/−1
- Command/TransferKey.hs +1/−1
- Command/TransferKeys.hs +1/−1
- Command/Trust.hs +1/−1
- Command/Unannex.hs +1/−1
- Command/Undo.hs +1/−1
- Command/Ungroup.hs +1/−1
- Command/Uninit.hs +1/−1
- Command/Unlock.hs +1/−1
- Command/Untrust.hs +1/−1
- Command/Unused.hs +1/−1
- Command/Upgrade.hs +1/−1
- Command/VAdd.hs +1/−1
- Command/VCycle.hs +1/−1
- Command/VFilter.hs +1/−1
- Command/VPop.hs +1/−1
- Command/Version.hs +1/−1
- Command/Vicfg.hs +1/−1
- Command/View.hs +1/−1
- Command/Wanted.hs +1/−1
- Command/Watch.hs +1/−1
- Command/WebApp.hs +1/−1
- Command/Whereis.hs +1/−1
- Command/XMPPGit.hs +1/−1
- Common.hs +3/−1
- Config.hs +3/−3
- Config/Cost.hs +1/−1
- Config/Files.hs +1/−1
- Config/NumCopies.hs +1/−1
- Creds.hs +1/−1
- Crypto.hs +1/−1
- Git.hs +1/−1
- Git/AutoCorrect.hs +1/−1
- Git/Branch.hs +1/−1
- Git/BuildVersion.hs +1/−1
- Git/CatFile.hs +1/−1
- Git/CheckAttr.hs +1/−1
- Git/CheckIgnore.hs +1/−1
- Git/Command.hs +1/−1
- Git/Command/Batch.hs +1/−1
- Git/Config.hs +1/−1
- Git/Construct.hs +1/−1
- Git/CurrentRepo.hs +1/−1
- Git/DiffTree.hs +1/−1
- Git/DiffTreeItem.hs +1/−1
- Git/FileMode.hs +1/−1
- Git/FilePath.hs +1/−1
- Git/Filename.hs +1/−1
- Git/Fsck.hs +1/−1
- Git/GCrypt.hs +1/−1
- Git/HashObject.hs +1/−1
- Git/Hook.hs +40/−1
- Git/Index.hs +1/−1
- Git/LsFiles.hs +1/−1
- Git/LsTree.hs +1/−1
- Git/Merge.hs +1/−1
- Git/Objects.hs +1/−1
- Git/Queue.hs +1/−1
- Git/Ref.hs +1/−1
- Git/RefLog.hs +1/−1
- Git/Remote.hs +1/−1
- Git/Remote/Remove.hs +1/−1
- Git/Repair.hs +1/−1
- Git/Sha.hs +1/−1
- Git/SharedRepository.hs +1/−1
- Git/Types.hs +1/−1
- Git/UnionMerge.hs +1/−1
- Git/UpdateIndex.hs +1/−1
- Git/Url.hs +1/−1
- Git/Version.hs +1/−1
- Limit.hs +2/−4
- Limit/Wanted.hs +1/−1
- Locations.hs +40/−65
- Logs.hs +23/−39
- Logs/Chunk.hs +7/−3
- Logs/Chunk/Pure.hs +1/−1
- Logs/Difference.hs +41/−0
- Logs/Difference/Pure.hs +25/−0
- Logs/FsckResults.hs +1/−1
- Logs/Group.hs +1/−1
- Logs/Location.hs +8/−3
- Logs/MapLog.hs +1/−1
- Logs/MetaData.hs +14/−8
- Logs/NumCopies.hs +1/−1
- Logs/PreferredContent.hs +4/−4
- Logs/PreferredContent/Raw.hs +1/−1
- Logs/Presence.hs +1/−1
- Logs/Presence/Pure.hs +1/−1
- Logs/Remote.hs +1/−1
- Logs/RemoteState.hs +8/−4
- Logs/Schedule.hs +1/−1
- Logs/SingleValue.hs +1/−1
- Logs/Transfer.hs +1/−1
- Logs/Transitions.hs +1/−1
- Logs/Trust.hs +1/−1
- Logs/Trust/Basic.hs +1/−1
- Logs/Trust/Pure.hs +1/−1
- Logs/UUID.hs +1/−1
- Logs/UUIDBased.hs +1/−1
- Logs/Unused.hs +1/−1
- Logs/View.hs +1/−1
- Logs/Web.hs +8/−5
- Messages.hs +1/−1
- Messages/JSON.hs +1/−1
- Remote.hs +10/−8
- Remote/BitTorrent.hs +1/−1
- Remote/Bup.hs +1/−1
- Remote/Ddar.hs +2/−3
- Remote/Directory.hs +3/−2
- Remote/Directory/LegacyChunked.hs +1/−1
- Remote/External.hs +2/−2
- Remote/External/Types.hs +1/−1
- Remote/GCrypt.hs +4/−3
- Remote/Git.hs +7/−7
- Remote/Glacier.hs +1/−1
- Remote/Helper/AWS.hs +1/−1
- Remote/Helper/Chunked.hs +2/−3
- Remote/Helper/Chunked/Legacy.hs +1/−1
- Remote/Helper/Encryptable.hs +1/−1
- Remote/Helper/Git.hs +16/−5
- Remote/Helper/Hooks.hs +1/−1
- Remote/Helper/Http.hs +2/−2
- Remote/Helper/Messages.hs +1/−1
- Remote/Helper/ReadOnly.hs +1/−1
- Remote/Helper/Special.hs +1/−1
- Remote/Helper/Ssh.hs +1/−1
- Remote/Hook.hs +4/−4
- Remote/List.hs +1/−1
- Remote/Rsync.hs +4/−3
- Remote/Rsync/RsyncUrl.hs +6/−4
- Remote/S3.hs +2/−2
- Remote/Tahoe.hs +1/−1
- Remote/Web.hs +1/−1
- Remote/WebDAV.hs +1/−1
- Remote/WebDAV/DavLocation.hs +4/−3
- RemoteDaemon/Common.hs +1/−1
- RemoteDaemon/Core.hs +23/−16
- RemoteDaemon/Transport.hs +1/−1
- RemoteDaemon/Transport/Ssh.hs +4/−4
- RemoteDaemon/Transport/Ssh/Types.hs +1/−1
- RemoteDaemon/Types.hs +3/−2
- Test.hs +1/−3
- Types.hs +1/−1
- Types/Availability.hs +1/−1
- Types/Backend.hs +1/−1
- Types/BranchState.hs +1/−1
- Types/CleanupActions.hs +1/−1
- Types/Command.hs +1/−1
- Types/Creds.hs +1/−1
- Types/Crypto.hs +1/−1
- Types/DesktopNotify.hs +1/−1
- Types/Difference.hs too large to diff
- Types/Distribution.hs too large to diff
- Types/FileMatcher.hs too large to diff
- Types/GitConfig.hs too large to diff
- Types/Group.hs too large to diff
- Types/Key.hs too large to diff
- Types/KeySource.hs too large to diff
- Types/LockPool.hs too large to diff
- Types/Messages.hs too large to diff
- Types/MetaData.hs too large to diff
- Types/NumCopies.hs too large to diff
- Types/Option.hs too large to diff
- Types/Remote.hs too large to diff
- Types/ScheduledActivity.hs too large to diff
- Types/StandardGroups.hs too large to diff
- Types/StoreRetrieve.hs too large to diff
- Types/TrustLevel.hs too large to diff
- Types/UUID.hs too large to diff
- Types/UrlContents.hs too large to diff
- Types/View.hs too large to diff
- Upgrade.hs too large to diff
- Upgrade/V0.hs too large to diff
- Upgrade/V1.hs too large to diff
- Upgrade/V2.hs too large to diff
- Upgrade/V3.hs too large to diff
- Upgrade/V4.hs too large to diff
- Utility/Applicative.hs too large to diff
- Utility/Base64.hs too large to diff
- Utility/Batch.hs too large to diff
- Utility/Bloom.hs too large to diff
- Utility/CoProcess.hs too large to diff
- Utility/CopyFile.hs too large to diff
- Utility/DBus.hs too large to diff
- Utility/Daemon.hs too large to diff
- Utility/Data.hs too large to diff
- Utility/DataUnits.hs too large to diff
- Utility/DirWatcher.hs too large to diff
- Utility/DirWatcher/FSEvents.hs too large to diff
- Utility/DirWatcher/INotify.hs too large to diff
- Utility/DirWatcher/Kqueue.hs too large to diff
- Utility/DirWatcher/Types.hs too large to diff
- Utility/DirWatcher/Win32Notify.hs too large to diff
- Utility/Directory.hs too large to diff
- Utility/DiskFree.hs too large to diff
- Utility/Dot.hs too large to diff
- Utility/DottedVersion.hs too large to diff
- Utility/Env.hs too large to diff
- Utility/Exception.hs too large to diff
- Utility/ExternalSHA.hs too large to diff
- Utility/FileMode.hs too large to diff
- Utility/FileSize.hs too large to diff
- Utility/FileSystemEncoding.hs too large to diff
- Utility/Format.hs too large to diff
- Utility/FreeDesktop.hs too large to diff
- Utility/Glob.hs too large to diff
- Utility/Gpg.hs too large to diff
- Utility/Hash.hs too large to diff
- Utility/HumanNumber.hs too large to diff
- Utility/HumanTime.hs too large to diff
- Utility/InodeCache.hs too large to diff
- Utility/JSONStream.hs too large to diff
- Utility/LinuxMkLibs.hs too large to diff
- Utility/LockFile.hs too large to diff
- Utility/LockFile/Posix.hs too large to diff
- Utility/LockFile/Windows.hs too large to diff
- Utility/LogFile.hs too large to diff
- Utility/Lsof.hs too large to diff
- Utility/Matcher.hs too large to diff
- Utility/Metered.hs too large to diff
- Utility/Misc.hs too large to diff
- Utility/Monad.hs too large to diff
- Utility/Mounts.hsc too large to diff
- Utility/Network.hs too large to diff
- Utility/NotificationBroadcaster.hs too large to diff
- Utility/OSX.hs too large to diff
- Utility/PID.hs too large to diff
- Utility/Parallel.hs too large to diff
- Utility/Path.hs too large to diff
- Utility/Percentage.hs too large to diff
- Utility/PosixFiles.hs too large to diff
- Utility/QuickCheck.hs too large to diff
- Utility/Quvi.hs too large to diff
- Utility/Rsync.hs too large to diff
- Utility/SRV.hs too large to diff
- Utility/SafeCommand.hs too large to diff
- Utility/Scheduled.hs too large to diff
- Utility/Shell.hs too large to diff
- Utility/SimpleProtocol.hs too large to diff
- Utility/SshConfig.hs too large to diff
- Utility/TList.hs too large to diff
- Utility/Tense.hs too large to diff
- Utility/ThreadLock.hs too large to diff
- Utility/ThreadScheduler.hs too large to diff
- Utility/Tmp.hs too large to diff
- Utility/Touch.hsc too large to diff
- Utility/URI.hs too large to diff
- Utility/Url.hs too large to diff
- Utility/UserInfo.hs too large to diff
- Utility/Verifiable.hs too large to diff
- Utility/WebApp.hs too large to diff
- Utility/WinProcess.hs too large to diff
- Utility/Yesod.hs too large to diff
- Utility/libdiskfree.c too large to diff
- Utility/libkqueue.c too large to diff
- Utility/libmounts.c too large to diff
- debian/changelog too large to diff
- debian/control too large to diff
- debian/copyright too large to diff
- doc/backends.mdwn too large to diff
- doc/backends/comment_11_f0f6316bbdc971a9ab157de9bbb9f74c._comment too large to diff
- doc/backends/comment_12_da76dff5fe712318d7d4313f1d827883._comment too large to diff
- doc/bugs/Build_fails_when_no_wget_avalible.mdwn too large to diff
- doc/bugs/Direct_mode_sync_fails_to_transfer_a_10GB_file.mdwn too large to diff
- doc/bugs/Forcing_https_for_Google_cloud_storage_remote__63__.mdwn too large to diff
- doc/bugs/How_to_use_a_DRA_bucket_in_Google_cloud_storage__63__.mdwn too large to diff
- doc/bugs/No_such_file_with_certain_filenames_using_WORM_backend.mdwn too large to diff
- doc/bugs/Revert_to_old_file_version_in_direct_mode___40__VFAT__41__.mdwn too large to diff
- doc/bugs/S3_Access_fails_on_windows.mdwn too large to diff
- doc/bugs/git-annex_assistant_not_working_with_nested_git_repos.mdwn too large to diff
- doc/bugs/git-annex_died_of_signal_11_when_syncing_content.mdwn too large to diff
- doc/bugs/git_annex_import_fails_on_filenames_with_newlines_in_them.mdwn too large to diff
- doc/bugs/git_annex_unused_fails_when_a_filename_contains_newline.mdwn too large to diff
- doc/bugs/git_annex_wont_work_with_git-dir_and_work-tree.mdwn too large to diff
- doc/bugs/glacier_fails_to_copy.mdwn too large to diff
- doc/bugs/windows_isExecutable_fail.mdwn too large to diff
- doc/chunking.mdwn too large to diff
- doc/contact.mdwn too large to diff
- doc/design/assistant/polls/Android_default_directory.mdwn too large to diff
- doc/design/assistant/polls/prioritizing_special_remotes.mdwn too large to diff
- doc/design/git-remote-daemon.mdwn too large to diff
- doc/design/v6.mdwn too large to diff
- doc/design/v6/comment_1_b7b4819211910556838ec37bc2b6b37b._comment too large to diff
- doc/design/v6/comment_2_8f35254d2cd5d0c273d5392ddd857c2d._comment too large to diff
- doc/devblog/day_246__old_todos.mdwn too large to diff
- doc/devblog/day_247__hooks_and_large_files_on_windows.mdwn too large to diff
- doc/devblog/day_248__workload_tuning.mdwn too large to diff
- doc/encryption.mdwn too large to diff
- doc/forum/Add_annex_files_outside_git_root_directory.mdwn too large to diff
- doc/forum/Alternative_to_XMPP_on_Windows__63__.mdwn too large to diff
- doc/forum/Is_there_any_delta_handling_for_file_modifications__63__.mdwn too large to diff
- doc/forum/Ubuntu_PPA/comment_8_feecd478a4d44cb5ffc7020c646174ba._comment too large to diff
- doc/forum/adding_remote_bup_repo_using_ssh.mdwn too large to diff
- doc/forum/example_of_massively_disconnected_operation.mdwn too large to diff
- doc/forum/git_annex_assistant_repository_history__63__.mdwn too large to diff
- doc/forum/scalability_with_lots_of_files.mdwn too large to diff
- doc/git-annex-shell.mdwn too large to diff
- doc/git-annex.mdwn too large to diff
- doc/git-union-merge.mdwn too large to diff
- doc/install/Ubuntu/comment_13_7964374bb2332940677eea570bdb0b69._comment too large to diff
- doc/install/Ubuntu/comment_14_b511063001af2e2170bef657cf016ff2._comment too large to diff
- doc/internals.mdwn too large to diff
- doc/internals/hashing/comment_3_19b7d20ca392078f14f9f10992f288ec._comment too large to diff
- doc/internals/hashing/comment_4_7642d6ce5fd4d37d464b05d0b4f869c6._comment too large to diff
- doc/news/version_5.20141125.mdwn too large to diff
- doc/news/version_5.20141203.mdwn too large to diff
- doc/news/version_5.20150205.mdwn too large to diff
- doc/news/version_5/comment_1_ae8c464ccb7b7b218efd9151c5bbd1a5._comment too large to diff
- doc/preferred_content.mdwn too large to diff
- doc/scalability/comment_1_a6656ae397277719d67d0953a28fe1d8._comment too large to diff
- doc/scalability/comment_2_71c7c3aa97284602d0f64c11a98d1782._comment too large to diff
- doc/special_remotes/S3.mdwn too large to diff
- doc/special_remotes/rsync.mdwn too large to diff
- doc/special_remotes/webdav.mdwn too large to diff
- doc/sync/comment_17_44a4ae4685c4bf2b4e7c61897eb3ff80._comment too large to diff
- doc/sync/comment_18_838fb249cd5be83962770d5cc394389a._comment too large to diff
- doc/thanks.mdwn too large to diff
- doc/tips/using_Amazon_S3.mdwn too large to diff
- doc/tips/using_box.com_as_a_special_remote.mdwn too large to diff
- doc/todo/Chunks_support_in_all_special_remotes.mdwn too large to diff
- doc/todo/Configuring_metadata_view_filenames.mdwn too large to diff
- doc/todo/Recursive_addurl_simlar_to_wget_--recursive.mdwn too large to diff
- doc/todo/__91__FR__93___No_consistency_check_while_on_battery-only.mdwn too large to diff
- doc/todo/notifications.mdwn too large to diff
- doc/todo/openwrt_package/comment_4_132e67b34f9c616217e037e4ecac70a4._comment too large to diff
- doc/todo/resuming_encrypted_uploads.mdwn too large to diff
- doc/todo/view_git_annex_log_in_webapp.mdwn too large to diff
- doc/tuning.mdwn too large to diff
- doc/tuning/comment_1_f8af8e9b696d32d238ebd56a3b8058c4._comment too large to diff
- doc/tuning/comment_2_a0091dbb39b79dfe101d05f9a5db216f._comment too large to diff
- doc/use_case/Bob.mdwn too large to diff
- doc/users/joey.mdwn too large to diff
- doc/walkthrough.mdwn too large to diff
- doc/walkthrough/renaming_files.mdwn too large to diff
- doc/walkthrough/using_special_remotes.mdwn too large to diff
- doc/walkthrough/using_ssh_remotes.mdwn too large to diff
- git-annex-shell.1 too large to diff
- git-annex.1 too large to diff
- git-annex.cabal too large to diff
- git-annex.hs too large to diff
- git-union-merge.hs too large to diff
@@ -1,6 +1,7 @@-Joey Hess <joey@kitenet.net> http://joey.kitenet.net/ <joey@web>-Joey Hess <joey@kitenet.net> http://joeyh.name/ <joey@web>-Joey Hess <joey@kitenet.net> http://joeyh.name/ <http://joeyh.name/@web>+Joey Hess <id@joeyh.name> http://joey.kitenet.net/ <joey@web>+Joey Hess <id@joeyh.name> http://joeyh.name/ <joey@web>+Joey Hess <id@joeyh.name> http://joeyh.name/ <http://joeyh.name/@web> Yaroslav Halchenko <debian@onerussian.com> Yaroslav Halchenko <debian@onerussian.com> http://yarikoptic.myopenid.com/ <site-myopenid@web> Yaroslav Halchenko <debian@onerussian.com> https://www.google.com/accounts/o8/id?id=AItOawnx8kHW66N3BqmkVpgtXDlYMvr8TJ5VvfY <Yaroslav@web>+Richard Hartmann <richih@debian.org> https://www.google.com/accounts/o8/id?id=AItOawl9sYlePmv1xK-VvjBdN-5doOa_Xw-jH4U <Richard@web>
@@ -1,6 +1,6 @@ {- git-annex monad -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -85,9 +85,7 @@ MonadReader (MVar AnnexState), MonadCatch, MonadThrow,-#if MIN_VERSION_exceptions(0,6,0) MonadMask,-#endif Functor, Applicative )
@@ -1,6 +1,6 @@ {- git-annex automatic merge conflict resolution -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -134,7 +134,7 @@ makelink key = do let dest = variantFile file key- l <- inRepo $ gitAnnexLink dest key+ l <- calcRepo $ gitAnnexLink dest key replacewithlink dest l stageSymlink dest =<< hashSymlink l
@@ -1,6 +1,6 @@ {- management of the git-annex branch -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -49,9 +49,11 @@ import Logs import Logs.Transitions import Logs.Trust.Pure+import Logs.Difference.Pure import Annex.ReplaceFile import qualified Annex.Queue import Annex.Branch.Transitions+import qualified Annex {- Name of the branch that is used to store git-annex's information. -} name :: Git.Ref@@ -160,6 +162,7 @@ <$> getLocal transitionsLog unless (null branches) $ do showSideAction merge_desc+ mapM_ checkBranchDifferences refs mergeIndex jl refs let commitrefs = nub $ fullname:refs unlessM (handleTransitions jl localtransitions commitrefs) $ do@@ -537,3 +540,11 @@ apply rest hasher file content' trustmap PreserveFile -> apply rest hasher file content trustmap++checkBranchDifferences :: Git.Ref -> Annex ()+checkBranchDifferences ref = do+ theirdiffs <- allDifferences . parseDifferencesLog . decodeBS+ <$> catFile ref differenceLog+ mydiffs <- annexDifferences <$> Annex.getGitConfig+ when (theirdiffs /= mydiffs) $+ error "Remote repository is tuned in incompatable way; cannot be merged with local repository."
@@ -1,6 +1,6 @@ {- git-annex branch transitions -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -2,7 +2,7 @@ - - Runtime state about the git-annex branch. -- - Copyright 2011-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git cat-file interface, with handle automatically stored in the Annex monad -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git check-attr interface, with handle automatically stored in the Annex monad -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,7 +1,7 @@ {- git check-ignore interface, with handle automatically stored in - the Annex monad -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex file content managing -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -110,10 +110,10 @@ ( checkOr is_unlocked lockfile , return is_missing )- checkOr def lockfile = do+ checkOr d lockfile = do v <- checkLocked lockfile return $ case v of- Nothing -> def+ Nothing -> d Just True -> is_locked Just False -> is_unlocked #else@@ -234,8 +234,8 @@ tmp <- fromRepo $ gitAnnexTmpObjectLocation key e <- liftIO $ doesFileExist tmp- alreadythere <- if e- then fromIntegral . fileSize <$> liftIO (getFileStatus tmp)+ alreadythere <- liftIO $ if e+ then getFileSize tmp else return 0 ifM (checkDiskSpace Nothing key alreadythere) ( do@@ -446,7 +446,7 @@ removeInodeCache key mapM_ (resetfile cache) fs resetfile cache f = whenM (sameInodeCache f cache) $ do- l <- inRepo $ gitAnnexLink f key+ l <- calcRepo $ gitAnnexLink f key secureErase f replaceFile f $ makeAnnexLink l
@@ -1,6 +1,6 @@ {- git-annex file content managing for direct mode -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -174,10 +174,10 @@ go (Just curr) = elemInodeCaches curr old {- Checks if a FileStatus matches the recorded InodeCache of a file. -}-sameFileStatus :: Key -> FileStatus -> Annex Bool-sameFileStatus key status = do+sameFileStatus :: Key -> FilePath -> FileStatus -> Annex Bool+sameFileStatus key f status = do old <- recordedInodeCache key- curr <- withTSDelta $ \delta -> liftIO $ toInodeCache delta status+ curr <- withTSDelta $ \delta -> liftIO $ toInodeCache delta f status case (old, curr) of (_, Just c) -> elemInodeCaches c old ([], Nothing) -> return True
@@ -0,0 +1,58 @@+{- git-annex repository differences+ -+ - Copyright 2015 Joey Hess <id@joeyh.name>+ -+ - Licensed under the GNU GPL version 3 or higher.+ -}++module Annex.Difference (+ module Types.Difference,+ setDifferences,+) where++import Common.Annex+import Types.Difference+import Logs.Difference+import Config+import Annex.UUID+import Logs.UUID+import Annex.Version+import qualified Annex++import qualified Data.Map as M++-- Differences are only allowed to be tweaked when initializing a+-- repository for the first time, and then only if there is not another+-- known uuid. If the repository was cloned from elsewhere, it inherits+-- the existing settings.+--+-- Must be called before setVersion, so it can check if this is the first+-- time the repository is being initialized.+setDifferences :: Annex ()+setDifferences = do+ u <- getUUID+ otherds <- allDifferences <$> recordedDifferences+ ds <- mappend otherds . annexDifferences <$> Annex.getGitConfig+ when (ds /= mempty) $ do+ ds' <- ifM (isJust <$> getVersion)+ ( do+ oldds <- recordedDifferencesFor u+ when (ds /= oldds) $+ warning $ "Cannot change tunable parameters in already initialized repository."+ return oldds+ , if otherds == mempty+ then ifM (not . null . filter (/= u) . M.keys <$> uuidMap)+ ( do+ warning "Cannot change tunable parameters in a clone of an existing repository."+ return mempty+ , return ds+ )+ else if otherds /= ds+ then do+ warning "The specified tunable parameters differ from values being used in other clones of this repository."+ return otherds+ else return ds+ )+ forM_ (listDifferences ds') $ \d ->+ setConfig (ConfigKey $ differenceConfigKey d) (differenceConfigVal d)+ recordDifferences ds' u
@@ -0,0 +1,86 @@+{- git-annex file locations+ -+ - Copyright 2010-2015 Joey Hess <id@joeyh.name>+ -+ - Licensed under the GNU GPL version 3 or higher.+ -}++module Annex.DirHashes (+ Hasher,+ HashLevels(..),+ objectHashLevels,+ branchHashLevels,+ branchHashDir,+ dirHashes,+ hashDirMixed,+ hashDirLower,+) where++import Data.Bits+import Data.Word+import Data.Hash.MD5+import Data.Default++import Common+import Types.Key+import Types.GitConfig+import Types.Difference++type Hasher = Key -> FilePath++-- Number of hash levels to use. 2 is the default.+newtype HashLevels = HashLevels Int++instance Default HashLevels where+ def = HashLevels 2++objectHashLevels :: GitConfig -> HashLevels+objectHashLevels = configHashLevels OneLevelObjectHash++branchHashLevels :: GitConfig -> HashLevels+branchHashLevels = configHashLevels OneLevelBranchHash++configHashLevels :: Difference -> GitConfig -> HashLevels+configHashLevels d config+ | hasDifference d (annexDifferences config) = HashLevels 1+ | otherwise = def++branchHashDir :: GitConfig -> Key -> String+branchHashDir config key = hashDirLower (branchHashLevels config) key++{- Two different directory hashes may be used. The mixed case hash+ - came first, and is fine, except for the problem of case-strict+ - filesystems such as Linux VFAT (mounted with shortname=mixed),+ - which do not allow using a directory "XX" when "xx" already exists.+ - To support that, most repositories use the lower case hash for new data. -}+dirHashes :: [HashLevels -> Hasher]+dirHashes = [hashDirLower, hashDirMixed]++hashDirs :: HashLevels -> Int -> String -> FilePath+hashDirs (HashLevels 1) sz s = addTrailingPathSeparator $ take sz s+hashDirs _ sz s = addTrailingPathSeparator $ take sz s </> drop sz s++hashDirMixed :: HashLevels -> Hasher+hashDirMixed n k = hashDirs n 2 $ take 4 $ display_32bits_as_dir =<< [a,b,c,d]+ where+ ABCD (a,b,c,d) = md5 $ md5FilePath $ key2file $ nonChunkKey k++hashDirLower :: HashLevels -> Hasher+hashDirLower n k = hashDirs n 3 $ take 6 $ md5s $ md5FilePath $ key2file $ nonChunkKey k++{- modified version of display_32bits_as_hex from Data.Hash.MD5+ - Copyright (C) 2001 Ian Lynagh + - License: Either BSD or GPL+ -}+display_32bits_as_dir :: Word32 -> String+display_32bits_as_dir w = trim $ swap_pairs cs+ where + -- Need 32 characters to use. To avoid inaverdently making+ -- a real word, use letters that appear less frequently.+ chars = ['0'..'9'] ++ "zqjxkmvwgpfZQJXKMVWGPF"+ cs = map (\x -> getc $ (shiftR w (6*x)) .&. 31) [0..7]+ getc n = chars !! fromIntegral n+ swap_pairs (x1:x2:xs) = x2:x1:swap_pairs xs+ swap_pairs _ = []+ -- Last 2 will always be 00, so omit.+ trim = take 6
@@ -1,6 +1,6 @@ {- git-annex direct mode -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -56,7 +56,7 @@ go (file, Just sha, Just mode) = withTSDelta $ \delta -> do shakey <- catKey sha mode mstat <- liftIO $ catchMaybeIO $ getSymbolicLinkStatus file- mcache <- liftIO $ maybe (pure Nothing) (toInodeCache delta) mstat+ mcache <- liftIO $ maybe (pure Nothing) (toInodeCache delta file) mstat filekey <- isAnnexLink file case (shakey, filekey, mstat, mcache) of (_, Just key, _, _)@@ -86,7 +86,7 @@ deletegit file stageannexlink file key = do- l <- inRepo $ gitAnnexLink file key+ l <- calcRepo $ gitAnnexLink file key stageSymlink file =<< hashSymlink l void $ addAssociatedFile key file @@ -131,7 +131,7 @@ return False got (Just (key, _)) = ifM (sameInodeCache file [cache]) ( do- l <- inRepo $ gitAnnexLink file key+ l <- calcRepo $ gitAnnexLink file key stageSymlink file =<< hashSymlink l addInodeCache key cache void $ addAssociatedFile key file@@ -282,7 +282,7 @@ - with the content. -} movein item makeabs k f = unlessM (goodContent k f) $ do preserveUnannexed item makeabs f oldref- l <- inRepo $ gitAnnexLink f k+ l <- calcRepo $ gitAnnexLink f k replaceFile f $ makeAnnexLink l toDirect k f
@@ -1,6 +1,6 @@ {- git-annex direct mode guard fixup -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- dropping of unwanted content -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex environment -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex file matching -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -28,12 +28,12 @@ checkFileMatcher matcher file = checkMatcher matcher Nothing (Just file) S.empty True checkMatcher :: (FileMatcher Annex) -> Maybe Key -> AssociatedFile -> AssumeNotPresent -> Bool -> Annex Bool-checkMatcher matcher mkey afile notpresent def- | isEmpty matcher = return def+checkMatcher matcher mkey afile notpresent d+ | isEmpty matcher = return d | otherwise = case (mkey, afile) of (_, Just file) -> go =<< fileMatchInfo file (Just key, _) -> go (MatchingKey key)- _ -> return def+ _ -> return d where go mi = matchMrun matcher $ \a -> a notpresent mi
@@ -4,7 +4,7 @@ - not change, otherwise removing old hooks using an old version of - the script would fail. -- - Copyright 2013-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2013-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -16,7 +16,6 @@ import Config import qualified Annex import Utility.Shell-import Utility.FileMode import qualified Data.Map as M @@ -53,19 +52,16 @@ - the existing hooks are cached. -} runAnnexHook :: Git.Hook -> Annex () runAnnexHook hook = do- cmd <- fromRepo $ Git.hookFile hook m <- Annex.getState Annex.existinghooks case M.lookup hook m of- Just True -> run cmd+ Just True -> run Just False -> noop Nothing -> do- exists <- hookexists cmd+ exists <- inRepo $ Git.hookExists hook Annex.changeState $ \s -> s { Annex.existinghooks = M.insert hook exists m }- when exists $- run cmd+ when exists run where- hookexists f = liftIO $ catchBoolIO $- isExecutable . fileMode <$> getFileStatus f- run cmd = unlessM (liftIO $ boolSystem cmd []) $- warning $ cmd ++ " failed"+ run = unlessM (inRepo $ Git.runHook hook) $ do+ h <- fromRepo $ Git.hookFile hook+ warning $ h ++ " failed"
@@ -1,6 +1,6 @@ {- Using other git index files -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex repository initialization -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -27,6 +27,7 @@ import Logs.Trust.Basic import Types.TrustLevel import Annex.Version+import Annex.Difference import Annex.UUID import Config import Annex.Direct@@ -44,7 +45,7 @@ genDescription :: Maybe String -> Annex String genDescription (Just d) = return d genDescription Nothing = do- reldir <- liftIO . relHome =<< fromRepo Git.repoPath+ reldir <- liftIO . relHome =<< liftIO . absPath =<< fromRepo Git.repoPath hostname <- fromMaybe "" <$> liftIO getHostname #ifndef mingw32_HOST_OS let at = if null hostname then "" else "@"@@ -73,6 +74,7 @@ checkCrippledFileSystem unlessM isBare $ hookWrite preCommitHook+ setDifferences setVersion supportedVersion ifM (crippledFileSystem <&&> not <$> isBare) ( do
@@ -4,7 +4,7 @@ - git-annex branch. Among other things, it ensures that if git-annex is - interrupted, its recorded data is not lost. -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -5,7 +5,7 @@ - On other filesystems, git instead stores the symlink target in a regular - file. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex lock files. -- - Copyright 2012, 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- making local repositories (used by webapp mostly) -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex metadata -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex metadata, standard fields -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex desktop notifications -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex program path -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex file permissions -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command queue -- - Copyright 2011, 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2011, 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- quvi options for git-annex -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex file replacing -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex ssh interface, with connection caching -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex tagged pushes -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex transfers -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -132,8 +132,7 @@ liftIO $ readMVar metervar | otherwise = do f <- fromRepo $ gitAnnexTmpObjectLocation (transferKey t)- liftIO $ catchDefaultIO 0 $- fromIntegral . fileSize <$> getFileStatus f+ liftIO $ catchDefaultIO 0 $ getFileSize f type RetryDecider = TransferInfo -> TransferInfo -> Bool
@@ -6,7 +6,7 @@ - UUIDs of remotes are cached in git config, using keys named - remote.<name>.annex-uuid -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,7 +1,7 @@ {- Url downloading, with git-annex user agent and configured http - headers and wget/curl options. -- - Copyright 2013-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2013-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex .variant files for automatic merge conflict resolution -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex repository versioning -- - Copyright 2010,2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010,2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- metadata based branch views -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -354,7 +354,7 @@ let metadata' = getfilemetadata f `unionMetaData` metadata forM_ (genviewedfiles f metadata') $ \fv -> do f' <- fromRepo $ fromTopFilePath $ asTopFilePath fv- stagesymlink uh hasher f' =<< inRepo (gitAnnexLink f' k)+ stagesymlink uh hasher f' =<< calcRepo (gitAnnexLink f' k) go uh hasher f Nothing | "." `isPrefixOf` f = do s <- liftIO $ getSymbolicLinkStatus f
@@ -1,6 +1,6 @@ {- filenames (not paths) used in views -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex checking whether content is wanted -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -15,15 +15,15 @@ {- Check if a file is preferred content for the local repository. -} wantGet :: Bool -> Maybe Key -> AssociatedFile -> Annex Bool-wantGet def key file = isPreferredContent Nothing S.empty key file def+wantGet d key file = isPreferredContent Nothing S.empty key file d {- Check if a file is preferred content for a remote. -} wantSend :: Bool -> Maybe Key -> AssociatedFile -> UUID -> Annex Bool-wantSend def key file to = isPreferredContent (Just to) S.empty key file def+wantSend d key file to = isPreferredContent (Just to) S.empty key file d {- Check if a file can be dropped, maybe from a remote. - Don't drop files that are preferred content. -} wantDrop :: Bool -> Maybe UUID -> Maybe Key -> AssociatedFile -> Annex Bool-wantDrop def from key file = do+wantDrop d from key file = do u <- maybe getUUID (return . id) from- not <$> isPreferredContent (Just u) (S.singleton u) key file def+ not <$> isPreferredContent (Just u) (S.singleton u) key file d
@@ -1,6 +1,6 @@ {- git-annex assistant daemon -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant alerts -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant alert utilities -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant git-annex branch change tracking -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant change tracking -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant commit tracking -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Common infrastructure for the git-annex assistant. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant CredPair cache. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant daemon status -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant remote deletion utilities -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant dropping of unwanted content -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant fscking -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant gpg stuff -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Assistant installation -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Assistant autostart file installation -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Assistant menu installation. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant remote creation utilities -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant monad -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant named threads. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant out of band network messager interface -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant repo pairing, core data types -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant pairing remote creation -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -23,12 +23,11 @@ {- Authorized keys are set up before pairing is complete, so that the other - side can immediately begin syncing. -} setupAuthorizedKeys :: PairMsg -> FilePath -> IO ()-setupAuthorizedKeys msg repodir = do- validateSshPubKey pubkey- unlessM (liftIO $ addAuthorizedKeys True repodir pubkey) $- error "failed setting up ssh authorized keys"- where- pubkey = remoteSshPubKey $ pairMsgData msg+setupAuthorizedKeys msg repodir = case validateSshPubKey $ remoteSshPubKey $ pairMsgData msg of+ Left err -> error err+ Right pubkey -> + unlessM (liftIO $ addAuthorizedKeys True repodir pubkey) $+ error "failed setting up ssh authorized keys" {- When local pairing is complete, this is used to set up the remote for - the host we paired with. -}
@@ -4,7 +4,7 @@ - each message is repeated until acknowledged. This is done using a - thread, that gets stopped before the next message is sent. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant push tracking -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant RemoteDaemon control -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant repository repair -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -140,8 +140,7 @@ repairStaleLocks :: [FilePath] -> Assistant () repairStaleLocks lockfiles = go =<< getsizes where- getsize lf = catchMaybeIO $ - (\s -> (lf, fileSize s)) <$> getFileStatus lf+ getsize lf = catchMaybeIO $ (\s -> (lf, s)) <$> getFileSize lf getsizes = liftIO $ catMaybes <$> mapM getsize lockfiles go [] = return () go l = ifM (liftIO $ null <$> Lsof.query ("--" : map fst l))
@@ -1,6 +1,6 @@ {- git-annex assistant remote problem handling -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant restarting -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -29,7 +29,6 @@ #else import Utility.WinProcess #endif-import Data.Default import Network.URI {- Before the assistant can be restarted, have to remove our @@ -96,7 +95,7 @@ - warp-tls listens to http, in order to show an error page, so this works. -} assistantListening :: URLString -> IO Bool-assistantListening url = catchBoolIO $ fst <$> exists url' def+assistantListening url = catchBoolIO $ exists url' def where url' = case parseURI url of Nothing -> url
@@ -1,6 +1,6 @@ {- git-annex assistant remotes needing scanning -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant ssh utilities -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -111,33 +111,25 @@ sshTranscript opts input = processTranscript "ssh" opts input {- Ensure that the ssh public key doesn't include any ssh options, like- - command=foo, or other weirdness -}-validateSshPubKey :: SshPubKey -> IO ()+ - command=foo, or other weirdness.+ -+ - The returned version of the key has its comment removed.+ -}+validateSshPubKey :: SshPubKey -> Either String SshPubKey validateSshPubKey pubkey- | length (lines pubkey) == 1 =- either error return $ check $ words pubkey- | otherwise = error "too many lines in ssh public key"+ | length (lines pubkey) == 1 = check $ words pubkey+ | otherwise = Left "too many lines in ssh public key" where- check [prefix, _key, comment] = do- checkprefix prefix- checkcomment comment- check [prefix, _key] =- checkprefix prefix+ check (prefix:key:_) = checkprefix prefix (unwords [prefix, key]) check _ = err "wrong number of words in ssh public key" - ok = Right () err msg = Left $ unwords [msg, pubkey] - checkprefix prefix- | ssh == "ssh" && all isAlphaNum keytype = ok+ checkprefix prefix validpubkey+ | ssh == "ssh" && all isAlphaNum keytype = Right validpubkey | otherwise = err "bad ssh public key prefix" where (ssh, keytype) = separate (== '-') prefix-- checkcomment comment = case filter (not . safeincomment) comment of- [] -> ok- badstuff -> err $ "bad comment in ssh public key (contains: \"" ++ badstuff ++ "\")"- safeincomment c = isAlphaNum c || c == '@' || c == '-' || c == '_' || c == '.' addAuthorizedKeys :: Bool -> FilePath -> SshPubKey -> IO Bool addAuthorizedKeys gitannexshellonly dir pubkey = boolSystem "sh"
@@ -1,6 +1,6 @@ {- git-annex assistant repo syncing -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant commit thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -352,7 +352,7 @@ done change mcache file key = liftAnnex $ do logStatus key InfoPresent link <- ifM isDirect- ( inRepo $ gitAnnexLink file key+ ( calcRepo $ gitAnnexLink file key , Command.Add.link file key mcache ) whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $
@@ -1,6 +1,6 @@ {- git-annex assistant config monitor thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant sceduled jobs runner -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant daemon status thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant Amazon Glacier retrieval -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant git merge thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant mount watcher, using either dbus or mtab polling -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant network connection watcher, using dbus -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant thread to listen for incoming pairing traffic -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant thread to handle fixing problems with repositories -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant git pushing thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant communication with remotedaemon -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant sanity checker -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -225,7 +225,7 @@ checkLogSize n = do f <- liftAnnex $ fromRepo gitAnnexLogFile logs <- liftIO $ listLogs f- totalsize <- liftIO $ sum <$> mapM filesize logs+ totalsize <- liftIO $ sum <$> mapM getFileSize logs when (totalsize > 2 * oneMegabyte) $ do notice ["Rotated logs due to size:", show totalsize] liftIO $ openLog f >>= handleToFd >>= redirLog@@ -237,9 +237,7 @@ checkLogSize (n + 1) _ -> noop where- filesize f = fromIntegral . fileSize <$> liftIO (getFileStatus f)-- oneMegabyte :: Int+ oneMegabyte :: Integer oneMegabyte = 1000000 #endif
@@ -1,6 +1,6 @@ {- git-annex assistant transfer polling thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -36,8 +36,7 @@ - temp file being used for the transfer. -} | transferDirection t == Download = do let f = gitAnnexTmpObjectLocation (transferKey t) g- sz <- liftIO $ catchMaybeIO $- fromIntegral . fileSize <$> getFileStatus f+ sz <- liftIO $ catchMaybeIO $ getFileSize f newsize t info sz {- Uploads don't need to be polled for when the TransferWatcher - thread can track file modifications. -}
@@ -1,6 +1,6 @@ {- git-annex assistant thread to scan remotes to find needed transfers -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant transfer watching thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant data transferrer thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant thread to detect when git-annex is upgraded -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant thread to detect when upgrade is available -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant tree watcher -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -224,7 +224,7 @@ v <- liftAnnex $ catKeyFile file case (v, fs) of (Just key, Just filestatus) ->- ifM (liftAnnex $ sameFileStatus key filestatus)+ ifM (liftAnnex $ sameFileStatus key file filestatus) {- It's possible to get an add event for - an existing file that is not - really modified, but it might have@@ -232,7 +232,7 @@ - so it symlink is restaged to make sure. -} ( ifM (shouldRestage <$> getDaemonStatus) ( do- link <- liftAnnex $ inRepo $ gitAnnexLink file key+ link <- liftAnnex $ calcRepo $ gitAnnexLink file key addLink file link (Just key) , noChange )@@ -279,7 +279,7 @@ go (Just key) = do when isdirect $ liftAnnex $ void $ addAssociatedFile key file- link <- liftAnnex $ inRepo $ gitAnnexLink file key+ link <- liftAnnex $ calcRepo $ gitAnnexLink file key if linktarget == Just link then ensurestaged (Just link) =<< getDaemonStatus else do
@@ -1,6 +1,6 @@ {- git-annex assistant webapp thread -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex XMPP client -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -9,7 +9,7 @@ - they would deadlock with only one thread. For larger numbers of - clients, the two threads are also sufficient. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant pending transfer queue -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant transfer slots -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- A pool of "git-annex transferkeys" processes -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant alert types -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant git-annex branch change tracking -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant buddies -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant change tracking -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant commit tracking -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant CredPair cache. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant daemon status -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- named threads -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant out of band network messager types -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant push tracking -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant RemoteDaemon control -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant repository problem tracking -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant remotes needing scanning -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- name of a thread -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- making the Annex monad available across threads -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant pending transfer queue -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant transfer slots -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- A pool of "git-annex transferkeys" processes available for use -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- webapp url renderer access from the assistant -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant unused files -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant upgrading -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp core -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp, common imports -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurators -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurators for Amazon AWS services -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp repository deletion -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurator for editing existing repos -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -144,13 +144,13 @@ legalName = makeLegalName . T.unpack . repoName editRepositoryAForm :: Maybe Remote -> RepoConfig -> MkAForm RepoConfig-editRepositoryAForm mremote def = RepoConfig+editRepositoryAForm mremote d = RepoConfig <$> areq (if ishere then readonlyTextField else textField)- (bfs "Name") (Just $ repoName def)- <*> aopt textField (bfs "Description") (Just $ repoDescription def)- <*> areq (selectFieldList groups `withNote` help) (bfs "Repository group") (Just $ repoGroup def)+ (bfs "Name") (Just $ repoName d)+ <*> aopt textField (bfs "Description") (Just $ repoDescription d)+ <*> areq (selectFieldList groups `withNote` help) (bfs "Repository group") (Just $ repoGroup d) <*> associateddirectory- <*> areq checkBoxField "Syncing enabled" (Just $ repoSyncable def)+ <*> areq checkBoxField "Syncing enabled" (Just $ repoSyncable d) where ishere = isNothing mremote isspecial = fromMaybe False $@@ -163,14 +163,14 @@ | isspecial = const True | otherwise = not . specialRemoteOnly customgroups :: [(Text, RepoGroup)]- customgroups = case repoGroup def of+ customgroups = case repoGroup d of RepoGroupCustom s -> [(T.pack s, RepoGroupCustom s)] _ -> [] help = [whamlet|<a href="@{RepoGroupR}">What's this?</a>|] - associateddirectory = case repoAssociatedDirectory def of+ associateddirectory = case repoAssociatedDirectory d of Nothing -> aopt hiddenField "" Nothing- Just d -> aopt textField (bfs "Associated directory") (Just $ Just d)+ Just dir -> aopt textField (bfs "Associated directory") (Just $ Just dir) getEditRepositoryR :: RepoId -> Handler Html getEditRepositoryR = postEditRepositoryR
@@ -1,6 +1,6 @@ {- git-annex assistant fsck configuration -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -167,8 +167,8 @@ <$> (annexFsckNudge <$> Annex.getGitConfig) fsckPreferencesAForm :: FsckPreferences -> MkAForm FsckPreferences-fsckPreferencesAForm def = FsckPreferences- <$> areq (checkBoxField `withNote` nudgenote) "Reminders" (Just $ enableFsckNudge def)+fsckPreferencesAForm d = FsckPreferences+ <$> areq (checkBoxField `withNote` nudgenote) "Reminders" (Just $ enableFsckNudge d) where nudgenote = [whamlet|Remind me when using repositories that lack consistency checks.|]
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurators for Internet Archive -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -191,7 +191,7 @@ getRepoInfo :: RemoteConfig -> Widget getRepoInfo c = do uo <- liftAnnex Url.getUrlOptions- exists <- liftIO $ catchDefaultIO False $ fst <$> Url.exists url uo+ exists <- liftIO $ catchDefaultIO False $ Url.exists url uo [whamlet| <a href="#{url}"> Internet Archive item
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurators for making local repositories -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurator for pairing -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant general preferences -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -34,17 +34,17 @@ } prefsAForm :: PrefsForm -> MkAForm PrefsForm-prefsAForm def = PrefsForm+prefsAForm d = PrefsForm <$> areq (storageField `withNote` diskreservenote)- (bfs "Disk reserve") (Just $ diskReserve def)+ (bfs "Disk reserve") (Just $ diskReserve d) <*> areq (positiveIntField `withNote` numcopiesnote)- (bfs "Number of copies") (Just $ numCopies def)+ (bfs "Number of copies") (Just $ numCopies d) <*> areq (checkBoxField `withNote` autostartnote)- "Auto start" (Just $ autoStart def)+ "Auto start" (Just $ autoStart d) <*> areq (selectFieldList autoUpgradeChoices)- (bfs autoUpgradeLabel) (Just $ autoUpgrade def)+ (bfs autoUpgradeLabel) (Just $ autoUpgrade d) <*> areq (checkBoxField `withNote` debugnote)- "Enable debug logging" (Just $ debugEnabled def)+ "Enable debug logging" (Just $ debugEnabled d) where diskreservenote = [whamlet|<br>Avoid downloading files from other repositories when there is too little free disk space.|] numcopiesnote = [whamlet|<br>Only drop a file after verifying that other repositories contain this many copies.|]
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurator for ssh-based remotes -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -91,15 +91,15 @@ #else sshInputAForm :: Field WebApp WebApp Text -> SshInput -> AForm WebApp WebApp SshInput #endif-sshInputAForm hostnamefield def = normalize <$> gen+sshInputAForm hostnamefield d = normalize <$> gen where gen = SshInput- <$> aopt check_hostname (bfs "Host name") (Just $ inputHostname def)- <*> aopt check_username (bfs "User name") (Just $ inputUsername def)- <*> areq (selectFieldList authmethods) (bfs "Authenticate with") (Just $ inputAuthMethod def)+ <$> aopt check_hostname (bfs "Host name") (Just $ inputHostname d)+ <*> aopt check_username (bfs "User name") (Just $ inputUsername d)+ <*> areq (selectFieldList authmethods) (bfs "Authenticate with") (Just $ inputAuthMethod d) <*> aopt passwordField (bfs "Password") Nothing- <*> aopt textField (bfs "Directory") (Just $ Just $ fromMaybe (T.pack gitAnnexAssistantDefaultDir) $ inputDirectory def)- <*> areq intField (bfs "Port") (Just $ inputPort def)+ <*> aopt textField (bfs "Directory") (Just $ Just $ fromMaybe (T.pack gitAnnexAssistantDefaultDir) $ inputDirectory d)+ <*> areq intField (bfs "Port") (Just $ inputPort d) authmethods :: [(Text, AuthMethod)] authmethods =@@ -133,10 +133,10 @@ -- The directory is implicitly in home, so remove any leading ~/ normalize i = i { inputDirectory = normalizedir <$> inputDirectory i }- normalizedir d- | "~/" `T.isPrefixOf` d = T.drop 2 d- | "/~/" `T.isPrefixOf` d = T.drop 3 d- | otherwise = d+ normalizedir dir+ | "~/" `T.isPrefixOf` dir = T.drop 2 dir+ | "/~/" `T.isPrefixOf` dir = T.drop 3 dir+ | otherwise = dir data ServerStatus = UntestedServer
@@ -1,6 +1,6 @@ {- git-annex assistant unused file preferences -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -26,11 +26,11 @@ } unusedForm :: UnusedForm -> Hamlet.Html -> MkMForm UnusedForm-unusedForm def msg = do+unusedForm d msg = do (enableRes, enableView) <- mreq (selectFieldList enabledisable) (bfs "")- (Just $ enableExpire def)+ (Just $ enableExpire d) (whenRes, whenView) <- mreq intField (bfs "")- (Just $ expireWhen def)+ (Just $ expireWhen d) let form = do webAppFormAuthToken $(widgetFile "configurators/unused/form")
@@ -1,6 +1,6 @@ {- git-annex assistant webapp upgrade UI -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp configurators for WebDAV remotes -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant XMPP configuration -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}@@ -161,8 +161,8 @@ creds2Form c = XMPPForm (xmppJID c) (xmppPassword c) xmppAForm :: (Maybe XMPPForm) -> MkAForm XMPPForm-xmppAForm def = XMPPForm- <$> areq jidField (bfs "Jabber address") (formJID <$> def)+xmppAForm d = XMPPForm+ <$> areq jidField (bfs "Jabber address") (formJID <$> d) <*> areq passwordField (bfs "Password") Nothing jidField :: MkField Text
@@ -1,6 +1,6 @@ {- git-annex assistant webapp control -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp dashboard -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp documentation -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp form utilities -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex webapp gpg stuff -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp making remotes -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp notifications -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp switching to other repos -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp page display -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant repository repair -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp RepoId type -- - Copyright 2012,2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012,2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp repository list -- - Copyright 2012,2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012,2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp sidebar -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex assistant webapp types -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU AGPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- core xmpp support -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- xmpp buddies -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- xmpp client support -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git over XMPP -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex key/value backends -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,12 +1,10 @@ {- git-tnnex hashing backends -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-}- module Backend.Hash ( backends, testKeyBackend,@@ -24,7 +22,7 @@ import qualified Data.ByteString.Lazy as L import Data.Char -data Hash = SHAHash HashSize | SkeinHash HashSize+data Hash = SHAHash HashSize | SkeinHash HashSize | MD5Hash type HashSize = Int {- Order is slightly significant; want SHA256 first, and more general@@ -32,9 +30,8 @@ hashes :: [Hash] hashes = concat [ map SHAHash [256, 1, 512, 224, 384]-#ifdef WITH_CRYPTOHASH , map SkeinHash [256, 512]-#endif+ , [MD5Hash] ] {- The SHA256E backend is the default, so genBackendE comes first. -}@@ -60,6 +57,7 @@ hashName :: Hash -> String hashName (SHAHash size) = "SHA" ++ show size hashName (SkeinHash size) = "SKEIN" ++ show size+hashName MD5Hash = "MD5" hashNameE :: Hash -> String hashNameE hash = hashName hash ++ "E"@@ -68,8 +66,7 @@ keyValue :: Hash -> KeySource -> Annex (Maybe Key) keyValue hash source = do let file = contentLocation source- stat <- liftIO $ getFileStatus file- let filesize = fromIntegral $ fileSize stat+ filesize <- liftIO $ getFileSize file s <- hashFile hash file filesize return $ Just $ stubKey { keyName = s@@ -103,7 +100,7 @@ mstat <- liftIO $ catchMaybeIO $ getFileStatus file case (mstat, fast) of (Just stat, False) -> do- let filesize = fromIntegral $ fileSize stat+ filesize <- liftIO $ getFileSize' file stat showSideAction "checksum" check <$> hashFile hash file filesize _ -> return True@@ -157,6 +154,7 @@ either error return =<< externalSHA command hashsize file go (SkeinHash hashsize) = skeinHasher hashsize <$> L.readFile file+ go MD5Hash = md5Hasher <$> L.readFile file shaHasher :: HashSize -> Integer -> Either (L.ByteString -> String) String shaHasher hashsize filesize@@ -179,11 +177,12 @@ skeinHasher :: HashSize -> (L.ByteString -> String) skeinHasher hashsize -#ifdef WITH_CRYPTOHASH | hashsize == 256 = show . skein256 | hashsize == 512 = show . skein512-#endif | otherwise = error $ "unsupported skein size " ++ show hashsize++md5Hasher :: L.ByteString -> String+md5Hasher = show . md5 {- A varient of the SHA256E backend, for testing that needs special keys - that cannot collide with legitimate keys in the repository.
@@ -1,6 +1,6 @@ {- git-annex "URL" backend -- keys whose content is available from urls. -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex backend utilities -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex "WORM" backend -- Write Once, Read Many -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -32,11 +32,13 @@ -} keyValue :: KeySource -> Annex (Maybe Key) keyValue source = do- stat <- liftIO $ getFileStatus $ contentLocation source+ let f = contentLocation source+ stat <- liftIO $ getFileStatus f+ sz <- liftIO $ getFileSize' f stat relf <- getTopFilePath <$> inRepo (toTopFilePath $ keyFilename source) return $ Just $ stubKey { keyName = genKeyName relf , keyBackendName = name backend- , keySize = Just $ fromIntegral $ fileSize stat+ , keySize = Just sz , keyMtime = Just $ modificationTime stat }
@@ -1,6 +1,6 @@ {- Bundled programs -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -15,6 +15,7 @@ import Utility.SafeCommand import Utility.ExternalSHA import Utility.Env+import Utility.Exception import qualified Git.Version import Utility.DottedVersion @@ -106,7 +107,8 @@ <$> getWgetVersion getWgetVersion :: IO (Maybe DottedVersion)-getWgetVersion = extract <$> readProcess "wget" ["--version"]+getWgetVersion = catchDefaultIO Nothing $+ extract <$> readProcess "wget" ["--version"] where extract s = case lines s of [] -> Nothing
@@ -1,7 +1,7 @@ {- Generating and installing a desktop menu entry file and icon, - and a desktop autostart file. (And OSX equivilants.) -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -22,6 +22,7 @@ import Data.Default import Data.Time.Clock import Data.Char+import System.Posix.Directory -- git-annex distribution signing key (for Joey Hess) signingKey :: String@@ -49,10 +50,12 @@ main :: IO () main = do+ version <- liftIO getChangelogVersion repodir <- getRepoDir+ changeWorkingDirectory repodir updated <- catMaybes <$> mapM (getbuild repodir) autobuilds- state <- Annex.new =<< Git.Construct.fromPath repodir- Annex.eval state (makeinfos updated)+ state <- Annex.new =<< Git.Construct.fromPath "."+ Annex.eval state (makeinfos updated version) -- Download a build from the autobuilder, and return its version. -- It's very important that the version matches the build, otherwise@@ -91,26 +94,25 @@ return $ if null bv || any (not . versionchar) bv then Nothing else Just bv versionchar c = isAlphaNum c || c == '.' || c == '-' -makeinfos :: [(FilePath, Version)] -> Annex ()-makeinfos updated = do+makeinfos :: [(FilePath, Version)] -> Version -> Annex ()+makeinfos updated version = do mapM_ (\f -> inRepo $ runBool [Param "annex", Param "add", File f]) (map fst updated)- version <- liftIO getChangelogVersion void $ inRepo $ runBool [ Param "commit" , Param "-a"+ , Param "-S89C809CB" -- git-annex distribution signing key , Param "-m" , Param $ "publishing git-annex " ++ version ]- basedir <- liftIO getRepoDir now <- liftIO getCurrentTime- liftIO $ putStrLn $ "building info files in " ++ basedir+ liftIO $ putStrLn $ "building info files" forM_ updated $ \(f, bv) -> do- v <- lookupFile (basedir </> f)+ v <- lookupFile f case v of Nothing -> noop Just k -> whenM (inAnnex k) $ do liftIO $ putStrLn f- let infofile = basedir </> f ++ ".info"+ let infofile = f ++ ".info" liftIO $ writeFile infofile $ show $ GitAnnexDistribution { distributionUrl = mkUrl f , distributionKey = k@@ -120,10 +122,11 @@ } void $ inRepo $ runBool [Param "add", File infofile] signFile infofile- signFile (basedir </> f)+ signFile f void $ inRepo $ runBool [ Param "commit" , Param "-m"+ , Param "-S89C809CB" -- git-annex distribution signing key , Param $ "updated info files for git-annex " ++ version ] void $ inRepo $ runBool@@ -137,14 +140,14 @@ -- Check for out of date info files. infos <- liftIO $ filter (".info" `isSuffixOf`)- <$> dirContentsRecursive (basedir </> "git-annex")+ <$> dirContentsRecursive "git-annex" ds <- liftIO $ forM infos (readish <$$> readFile) let dis = zip infos ds- let ood = filter (outofdate version) dis+ let ood = filter outofdate dis unless (null ood) $ error $ "Some info files are out of date: " ++ show (map fst ood) where- outofdate version (_, md) = case md of+ outofdate (_, md) = case md of Nothing -> True Just d -> distributionVersion d /= version
@@ -3,7 +3,7 @@ - - See https://ghc.haskell.org/trac/ghc/ticket/8596 -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -23,7 +23,7 @@ - need modifications to compile. - -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,7 +1,7 @@ {- Generating and installing a desktop menu entry file and icon, - and a desktop autostart file. (And OSX equivilants.) -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Linux library copier and binary shimmer -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -11,7 +11,7 @@ - exception of git. The user needs to install git separately, - and the installer checks for that. - - - Copyright 2013 Joey Hess <joey@kitenet.net> + - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} @@ -44,7 +44,9 @@ return p webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git-annex webapp" autostartscript <- vbsLauncher tmpdir "git-annex-autostart" "git annex assistant --autostart" - writeFile nsifile $ makeInstaller gitannex license + let htmlhelp = tmpdir </> "git-annex.html" + writeFile htmlhelp htmlHelpText + writeFile nsifile $ makeInstaller gitannex license htmlhelp (catMaybes extrabins) [ webappscript, autostartscript ] mustSucceed "makensis" [File nsifile] @@ -98,8 +100,8 @@ , fromString "You can install git from http:////git-scm.com//" ] -makeInstaller :: FilePath -> FilePath -> [FilePath] -> [FilePath] -> String -makeInstaller gitannex license extrabins launchers = nsis $ do +makeInstaller :: FilePath -> FilePath -> FilePath -> [FilePath] -> [FilePath] -> String +makeInstaller gitannex license htmlhelp extrabins launchers = nsis $ do name "git-annex" outFile $ str installer {- Installing into the same directory as git avoids needing to modify @@ -137,6 +139,8 @@ setOutPath "$INSTDIR\\cmd" mapM_ addfile (gitannex:extrabins) section "meta" [] $ do + setOutPath "$INSTDIR\\doc\\git\\html" + addfile htmlhelp setOutPath "$INSTDIR" addfile license mapM_ addfile launchers @@ -145,6 +149,7 @@ delete [RebootOK] $ startMenuItem delete [RebootOK] $ autoStartItem removefilesFrom "$INSTDIR/cmd" (gitannex:extrabins) + removefilesFrom "$INSTDIR\\doc\\git\\html" [htmlhelp] removefilesFrom "$INSTDIR" $ launchers ++ [ license @@ -195,4 +200,17 @@ , "cygreadline7.dll" , "cygncursesw-10.dll" , "cygusb0.dll" + ] + +-- msysgit opens Program Files/Git/doc/git/html/git-annex.html +-- when git annex --help is run. +htmlHelpText :: String +htmlHelpText = unlines + [ "<html>" + , "<title>git-annex help</title>" + , "<body>" + , "For help on git-annex, run \"git annex help\", or" + , "<a href=\"https://git-annex.branchable.com/git-annex/\">read the man page</a>." + , "</body>" + , "</html" ]
@@ -1,6 +1,6 @@ {- OSX library copier -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Makes standalone bundle. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex build flags reporting -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -80,11 +80,6 @@ #endif #ifdef WITH_TDFA , "TDFA"-#endif-#ifdef WITH_CRYPTOHASH- , "CryptoHash"-#else-#warning Building without CryptoHash. #endif #ifdef WITH_TORRENTPARSER , "TorrentParser"
@@ -1,3 +1,40 @@+git-annex (5.20150205) unstable; urgency=medium++ * info: Can now display info about a given uuid.+ * Added to remote/uuid info: Count of the number of keys present+ on the remote, and their size. This is rather expensive to calculate,+ so comes last and --fast will disable it.+ * info remote: Include the date of the last sync with the remote.+ * sync: Added --message/-m option like git commit.+ * remotedaemon: Fix problem that could prevent ssh connections being+ made after two LOSTNET messages were received in a row (perhaps due to+ two different network interfaces being brought down).+ * Fix build failure when wget is not installed.+ * Fix wording of message displayed when unable to get a file that+ is available in untrusted repositories.+ * addurl: When a Content-Disposition header suggests a filename to use,+ addurl will consider using it, if it's reasonable and doesn't conflict+ with an existing file. (--file overrides this)+ * Fix default repository description created by git annex init,+ which got broken by the relative path changes in the last release.+ * init: Repository tuning parameters can now be passed when initializing a+ repository for the first time. For details, see+ http://git-annex.branchable.com/tuning/+ * merge: Refuse to merge changes from a git-annex branch of a repo+ that has been tuned in incompatible ways.+ * Support annex.tune.objecthash1, annex.tune.objecthashlower, and+ annex.tune.branchhash1.+ * Remove support for building without cryptohash.+ * Added MD5 and MD5E backends.+ * assistant: Fix local pairing when ssh pubkey comment contains spaces.+ * Avoid using fileSize which maxes out at just 2 gb on Windows.+ Instead, use hFileSize, which doesn't have a bounded size.+ Fixes support for files > 2 gb on Windows.+ * Windows: Fix running of the pre-commit-annex hook.+ * Windows: Fix S3 special remote; need to call withSocketsDo. Thanks, Trent.++ -- Joey Hess <id@joeyh.name> Thu, 05 Feb 2015 14:08:33 -0400+ git-annex (5.20150113) unstable; urgency=medium * unlock: Don't allow unlocking files that have never been committed to git
@@ -2,30 +2,30 @@ Source: native package Files: *-Copyright: © 2010-2014 Joey Hess <joey@kitenet.net>+Copyright: © 2010-2015 Joey Hess <id@joeyh.name> License: GPL-3+ Files: Assistant/WebApp.hs Assistant/WebApp/* templates/* static/*-Copyright: © 2012-2014 Joey Hess <joey@kitenet.net>+Copyright: © 2012-2014 Joey Hess <id@joeyh.name> © 2014 Sören Brunk License: AGPL-3+ Files: Remote/Ddar.hs-Copyright: © 2011 Joey Hess <joey@kitenet.net>+Copyright: © 2011 Joey Hess <id@joeyh.name> © 2014 Robie Basak <robie@justgohome.co.uk> License: GPL-3+ Files: Utility/ThreadScheduler.hs Copyright: 2011 Bas van Dijk & Roel van Dijk- 2012, 2013 Joey Hess <joey@kitenet.net>+ 2012, 2013 Joey Hess <id@joeyh.name> License: BSD-2-clause Files: Utility/*-Copyright: 2012-2014 Joey Hess <joey@kitenet.net>+Copyright: 2012-2015 Joey Hess <id@joeyh.name> License: BSD-2-clause Files: Utility/Gpg.hs Utility/DirWatcher*-Copyright: © 2010-2014 Joey Hess <joey@kitenet.net>+Copyright: © 2010-2014 Joey Hess <id@joeyh.name> License: GPL-3+ Files: Assistant/WebApp/Bootstrap3.hs@@ -34,7 +34,7 @@ Files: doc/logo* */favicon.ico standalone/osx/git-annex.app/Contents/Resources/git-annex.icns standalone/android/icons/* Copyright: 2007 Henrik Nyh <http://henrik.nyh.se/>- 2010 Joey Hess <joey@kitenet.net>+ 2010 Joey Hess <id@joeyh.name> 2013 John Lawrence License: other Free to modify and redistribute with due credit, and obviously free to use.@@ -46,14 +46,14 @@ Files: Utility/libmounts.c Copyright: 1980, 1989, 1993, 1994 The Regents of the University of California 2001 David Rufino <daverufino@btinternet.com>- 2012 Joey Hess <joey@kitenet.net>+ 2012 Joey Hess <id@joeyh.name> License: BSD-3-clause * Copyright (c) 1980, 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Copyright (c) 2001 * David Rufino <daverufino@btinternet.com> * Copyright 2012- * Joey Hess <joey@kitenet.net>+ * Joey Hess <id@joeyh.name> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions
@@ -3,7 +3,7 @@ - Common sanity checks for commands, and an interface to selectively - remove them, or add others. - - - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command line parsing and dispatch -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command-line actions -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex main program -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex options -- - Copyright 2010, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex-shell main program -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex-shell fields -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- common command-line options -- - Copyright 2010-2011 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -4,7 +4,7 @@ - the values a user passes to a command, and prepare actions operating - on them. -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex usage messages -- - Copyright 2010-2011 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command infrastructure -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -160,8 +160,9 @@ ingest (Just source) = withTSDelta $ \delta -> do backend <- chooseBackend $ keyFilename source k <- genKey source backend- ms <- liftIO $ catchMaybeIO $ getFileStatus $ contentLocation source- mcache <- maybe (pure Nothing) (liftIO . toInodeCache delta) ms+ let src = contentLocation source+ ms <- liftIO $ catchMaybeIO $ getFileStatus src+ mcache <- maybe (pure Nothing) (liftIO . toInodeCache delta src) ms case (mcache, inodeCache source) of (_, Nothing) -> go k mcache ms (Just newc, Just c) | compareStrong c newc -> go k mcache ms@@ -229,7 +230,7 @@ {- Creates the symlink to the annexed content, returns the link target. -} link :: FilePath -> Key -> Maybe InodeCache -> Annex String link file key mcache = flip catchNonAsync (undo file key) $ do- l <- inRepo $ gitAnnexLink file key+ l <- calcRepo $ gitAnnexLink file key replaceFile file $ makeAnnexLink l -- touch symlink to have same time as the original file,@@ -271,7 +272,7 @@ cleanup file key mcache hascontent = do ifM (isDirect <&&> pure hascontent) ( do- l <- inRepo $ gitAnnexLink file key+ l <- calcRepo $ gitAnnexLink file key stageSymlink file =<< hashSymlink l , addLink file key mcache )
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -120,17 +120,16 @@ loguri = setDownloader uri OtherDownloader startWeb :: Bool -> Maybe FilePath -> Maybe Int -> String -> CommandStart-startWeb relaxed optfile pathdepth s = go $ fromMaybe bad $ parseURI s+startWeb relaxed optfile pathdepth s = go $ fromMaybe bad $ parseURI urlstring where- (s', downloader) = getDownloader s- bad = fromMaybe (error $ "bad url " ++ s') $- parseURI $ escapeURIString isUnescapedInURI s'- choosefile = flip fromMaybe optfile+ (urlstring, downloader) = getDownloader s+ bad = fromMaybe (error $ "bad url " ++ urlstring) $+ parseURI $ escapeURIString isUnescapedInURI urlstring go url = case downloader of QuviDownloader -> usequvi _ -> #ifdef WITH_QUVI- ifM (quviSupported s')+ ifM (quviSupported urlstring) ( usequvi , regulardownload url )@@ -139,30 +138,44 @@ #endif regulardownload url = do pathmax <- liftIO $ fileNameLengthLimit "."- let file = choosefile $ url2file url pathdepth pathmax+ urlinfo <- if relaxed+ then pure $ Url.UrlInfo True Nothing Nothing+ else Url.withUrlOptions (Url.getUrlInfo urlstring)+ file <- case optfile of+ Just f -> pure f+ Nothing -> case Url.urlSuggestedFile urlinfo of+ Nothing -> pure $ url2file url pathdepth pathmax+ Just sf -> do+ let f = truncateFilePath pathmax $+ sanitizeFilePath sf+ ifM (liftIO $ doesFileExist f <||> doesDirectoryExist f)+ ( pure $ url2file url pathdepth pathmax+ , pure f+ ) showStart "addurl" file- next $ performWeb relaxed s' file+ next $ performWeb relaxed urlstring file urlinfo #ifdef WITH_QUVI- badquvi = error $ "quvi does not know how to download url " ++ s'+ badquvi = error $ "quvi does not know how to download url " ++ urlstring usequvi = do page <- fromMaybe badquvi- <$> withQuviOptions Quvi.forceQuery [Quvi.quiet, Quvi.httponly] s'+ <$> withQuviOptions Quvi.forceQuery [Quvi.quiet, Quvi.httponly] urlstring let link = fromMaybe badquvi $ headMaybe $ Quvi.pageLinks page pathmax <- liftIO $ fileNameLengthLimit "."- let file = choosefile $ truncateFilePath pathmax $ sanitizeFilePath $- Quvi.pageTitle page ++ "." ++ Quvi.linkSuffix link+ let file = flip fromMaybe optfile $+ truncateFilePath pathmax $ sanitizeFilePath $+ Quvi.pageTitle page ++ "." ++ Quvi.linkSuffix link showStart "addurl" file- next $ performQuvi relaxed s' (Quvi.linkUrl link) file+ next $ performQuvi relaxed urlstring (Quvi.linkUrl link) file #else usequvi = error "not built with quvi support" #endif -performWeb :: Bool -> URLString -> FilePath -> CommandPerform-performWeb relaxed url file = ifAnnexed file addurl geturl+performWeb :: Bool -> URLString -> FilePath -> Url.UrlInfo -> CommandPerform+performWeb relaxed url file urlinfo = ifAnnexed file addurl geturl where- geturl = next $ isJust <$> addUrlFile relaxed url file- addurl = addUrlChecked relaxed url webUUID checkexistssize- checkexistssize = Url.withUrlOptions . Url.check url . keySize+ geturl = next $ isJust <$> addUrlFile relaxed url urlinfo file+ addurl = addUrlChecked relaxed url webUUID $ \k -> return $+ (Url.urlExists urlinfo, Url.urlSize urlinfo == keySize k) #ifdef WITH_QUVI performQuvi :: Bool -> URLString -> URLString -> FilePath -> CommandPerform@@ -189,7 +202,8 @@ - retained, because the size of a video stream - might change and we want to be able to download - it later. -}- sizedkey <- addSizeUrlKey videourl key+ urlinfo <- Url.withUrlOptions (Url.getUrlInfo videourl)+ let sizedkey = addSizeUrlKey urlinfo key prepGetViaTmpChecked sizedkey Nothing $ do tmp <- fromRepo $ gitAnnexTmpObjectLocation key showOutput@@ -225,17 +239,17 @@ stop ) -addUrlFile :: Bool -> URLString -> FilePath -> Annex (Maybe Key)-addUrlFile relaxed url file = do+addUrlFile :: Bool -> URLString -> Url.UrlInfo -> FilePath -> Annex (Maybe Key)+addUrlFile relaxed url urlinfo file = do liftIO $ createDirectoryIfMissing True (parentDir file) ifM (Annex.getState Annex.fast <||> pure relaxed)- ( nodownload relaxed url file- , downloadWeb url file+ ( nodownload url urlinfo file+ , downloadWeb url urlinfo file ) -downloadWeb :: URLString -> FilePath -> Annex (Maybe Key)-downloadWeb url file = do- dummykey <- addSizeUrlKey url =<< Backend.URL.fromUrl url Nothing+downloadWeb :: URLString -> Url.UrlInfo -> FilePath -> Annex (Maybe Key)+downloadWeb url urlinfo file = do+ dummykey <- addSizeUrlKey urlinfo <$> Backend.URL.fromUrl url Nothing let downloader f _ = do showOutput downloadUrl [url] f@@ -272,15 +286,9 @@ liftIO $ createDirectoryIfMissing True (parentDir tmp) downloader tmp p -{- Hits the url to get the size, if available.- -- - This is needed to avoid exceeding the diskreserve when downloading,- - and so the assistant can display a pretty progress bar.- -}-addSizeUrlKey :: URLString -> Key -> Annex Key-addSizeUrlKey url key = do- size <- snd <$> Url.withUrlOptions (Url.exists url)- return $ key { keySize = size }+{- Adds the url size to the Key. -}+addSizeUrlKey :: Url.UrlInfo -> Key -> Key+addSizeUrlKey urlinfo key = key { keySize = Url.urlSize urlinfo } cleanup :: UUID -> URLString -> FilePath -> Key -> Maybe FilePath -> Annex () cleanup u url file key mtmp = do@@ -295,19 +303,15 @@ Annex.Queue.flush maybe noop (moveAnnex key) mtmp -nodownload :: Bool -> URLString -> FilePath -> Annex (Maybe Key)-nodownload relaxed url file = do- (exists, size) <- if relaxed- then pure (True, Nothing)- else Url.withUrlOptions (Url.exists url)- if exists- then do- key <- Backend.URL.fromUrl url size- cleanup webUUID url file key Nothing- return (Just key)- else do- warning $ "unable to access url: " ++ url- return Nothing+nodownload :: URLString -> Url.UrlInfo -> FilePath -> Annex (Maybe Key)+nodownload url urlinfo file+ | Url.urlExists urlinfo = do+ key <- Backend.URL.fromUrl url (Url.urlSize urlinfo)+ cleanup webUUID url file key Nothing+ return (Just key)+ | otherwise = do+ warning $ "unable to access url: " ++ url+ return Nothing url2file :: URI -> Maybe Int -> Int -> FilePath url2file url pathdepth pathmax = case pathdepth of
@@ -1,6 +1,6 @@ {- git-annex assistant -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -156,7 +156,7 @@ show (length have) ++ " out of " ++ show (fromNumCopies need) ++ " necessary copies" Remote.showTriedRemotes bad- Remote.showLocations key (have++skip)+ Remote.showLocations True key (have++skip) "Rather than dropping this file, try using: git annex move" hint return False
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010,2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010,2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,12 +1,13 @@ {- git-annex command -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} module Command.Find where +import Data.Default import qualified Data.Map as M import Common.Annex@@ -65,8 +66,8 @@ , ("bytesize", size show) , ("humansize", size $ roughSize storageUnits True) , ("keyname", keyName key)- , ("hashdirlower", hashDirLower key)- , ("hashdirmixed", hashDirMixed key)+ , ("hashdirlower", hashDirLower def key)+ , ("hashdirmixed", hashDirMixed def key) , ("mtime", whenavail show $ keyMtime key) ] where
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -28,7 +28,7 @@ {- Fixes the symlink to an annexed file. -} start :: FilePath -> Key -> CommandStart start file key = do- link <- inRepo $ gitAnnexLink file key+ link <- calcRepo $ gitAnnexLink file key stopUnless ((/=) (Just link) <$> liftIO (catchMaybeIO $ readSymbolicLink file)) $ do showStart "fix" file next $ perform file link
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -33,7 +33,7 @@ perform :: Key -> FilePath -> CommandPerform perform key file = do- link <- inRepo $ gitAnnexLink file key+ link <- calcRepo $ gitAnnexLink file key liftIO $ createDirectoryIfMissing True (parentDir file) liftIO $ createSymbolicLink link file next $ cleanup file
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -192,7 +192,7 @@ -} fixLink :: Key -> FilePath -> Annex Bool fixLink key file = do- want <- inRepo $ gitAnnexLink file key+ want <- calcRepo $ gitAnnexLink file key have <- getAnnexLinkTarget file maybe noop (go want) have return True@@ -303,8 +303,7 @@ checkKeySizeOr bad key file = case Types.Key.keySize key of Nothing -> return True Just size -> do- size' <- fromIntegral . fileSize- <$> liftIO (getFileStatus file)+ size' <- liftIO $ getFileSize file comparesizes size size' where comparesizes a b = do
@@ -1,6 +1,6 @@ {- git-annex fuzz generator -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -79,7 +79,7 @@ ( docopy r witness <||> trycopy full rs witness , trycopy full rs witness )- showlocs = Remote.showLocations key []+ showlocs = Remote.showLocations False key [] "No other repository is known to contain the file." -- This check is to avoid an ugly message if a remote is a -- drive that is not mounted.
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -144,7 +144,9 @@ rundownload url (takeExtension url) $ \f -> do r <- Remote.claimingUrl url if Remote.uuid r == webUUID- then maybeToList <$> addUrlFile relaxed url f+ then do+ urlinfo <- Url.withUrlOptions (Url.getUrlInfo url)+ maybeToList <$> addUrlFile relaxed url urlinfo f else do res <- tryNonAsync $ maybe (error $ "unable to checkUrl of " ++ Remote.name r)
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -88,7 +88,7 @@ v <- tryNonAsync (moveAnnex k f) case v of Right _ -> do - l <- inRepo $ gitAnnexLink f k+ l <- calcRepo $ gitAnnexLink f k liftIO $ createSymbolicLink l f Left e -> catchNonAsync (Command.Add.undo f k e) warnlocked
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -29,6 +29,7 @@ import Types.Key import Logs.UUID import Logs.Trust+import Logs.Location import Config.NumCopies import Remote import Config@@ -65,11 +66,12 @@ data StatInfo = StatInfo { presentData :: Maybe KeyData , referencedData :: Maybe KeyData+ , remoteData :: M.Map UUID KeyData , numCopiesStats :: Maybe NumCopiesStats }- + emptyStatInfo :: StatInfo-emptyStatInfo = StatInfo Nothing Nothing Nothing+emptyStatInfo = StatInfo Nothing Nothing M.empty Nothing -- a state monad for running Stats in type StatState = StateT StatInfo Annex@@ -104,11 +106,16 @@ v <- Remote.byName' p case v of Right r -> remoteInfo r- Left _ -> maybe noinfo (fileInfo p) =<< isAnnexLink p+ Left _ -> do+ v' <- Remote.nameToUUID' p+ case v' of+ Right u -> uuidInfo u+ Left _ -> maybe noinfo (fileInfo p)+ =<< isAnnexLink p ) where isdir = liftIO . catchBoolIO . (isDirectory <$$> getFileStatus)- noinfo = error $ p ++ " is not a directory or an annexed file or a remote"+ noinfo = error $ p ++ " is not a directory or an annexed file or a remote or a uuid" dirInfo :: FilePath -> Annex () dirInfo dir = showCustom (unwords ["info", dir]) $ do@@ -126,9 +133,16 @@ remoteInfo :: Remote -> Annex () remoteInfo r = showCustom (unwords ["info", Remote.name r]) $ do info <- map (\(k, v) -> simpleStat k (pure v)) <$> Remote.getInfo r- evalStateT (mapM_ showStat (remote_stats r ++ info)) emptyStatInfo+ l <- selStats (remote_fast_stats r ++ info) (uuid_slow_stats (Remote.uuid r))+ evalStateT (mapM_ showStat l) emptyStatInfo return True +uuidInfo :: UUID -> Annex ()+uuidInfo u = showCustom (unwords ["info", fromUUID u]) $ do+ l <- selStats [] ((uuid_slow_stats u))+ evalStateT (mapM_ showStat l) emptyStatInfo+ return True+ selStats :: [Stat] -> [Stat] -> Annex [Stat] selStats fast_stats slow_stats = do fast <- Annex.getState Annex.fast@@ -179,8 +193,8 @@ , key_name k ] -remote_stats :: Remote -> [Stat]-remote_stats r = map (\s -> s r)+remote_fast_stats :: Remote -> [Stat]+remote_fast_stats r = map (\s -> s r) [ remote_name , remote_description , remote_uuid@@ -188,6 +202,12 @@ , remote_type ] +uuid_slow_stats :: UUID -> [Stat]+uuid_slow_stats u = map (\s -> s u)+ [ remote_annex_keys+ , remote_annex_size+ ]+ stat :: String -> (String -> StatState String) -> Stat stat desc a = return $ Just (desc, a desc) @@ -262,6 +282,14 @@ local_annex_size = simpleStat "local annex size" $ showSizeKeys <$> cachedPresentData +remote_annex_keys :: UUID -> Stat+remote_annex_keys u = stat "remote annex keys" $ json show $+ countKeys <$> cachedRemoteData u++remote_annex_size :: UUID -> Stat+remote_annex_size u = simpleStat "remote annex size" $+ showSizeKeys <$> cachedRemoteData u+ known_annex_files :: Stat known_annex_files = stat "annexed files in working tree" $ json show $ countKeys <$> cachedReferencedData@@ -361,6 +389,16 @@ put s { presentData = Just v } return v +cachedRemoteData :: UUID -> StatState KeyData+cachedRemoteData u = do+ s <- get+ case M.lookup u (remoteData s) of+ Just v -> return v+ Nothing -> do+ v <- foldKeys <$> lift (loggedKeysFor u)+ put s { remoteData = M.insert u v (remoteData s) }+ return v+ cachedReferencedData :: StatState KeyData cachedReferencedData = do s <- get@@ -383,7 +421,7 @@ (presentdata, referenceddata, numcopiesstats) <- Command.Unused.withKeysFilesReferencedIn dir initial (update matcher fast)- return $ StatInfo (Just presentdata) (Just referenceddata) (Just numcopiesstats)+ return $ StatInfo (Just presentdata) (Just referenceddata) M.empty (Just numcopiesstats) where initial = (emptyKeyData, emptyKeyData, emptyNumCopiesStats) update matcher fast key file vs@(presentdata, referenceddata, numcopiesstats) =@@ -451,8 +489,7 @@ keysizes keys = do dir <- lift $ fromRepo dirspec liftIO $ forM keys $ \k -> catchDefaultIO 0 $- fromIntegral . fileSize - <$> getFileStatus (dir </> keyFile k)+ getFileSize (dir </> keyFile k) aside :: String -> String aside s = " (" ++ s ++ ")"
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011,2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011,2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - Copyright 2013 Antoine Beaupré - - Licensed under the GNU GPL version 3 or higher.
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -141,7 +141,8 @@ getLog key os = do top <- fromRepo Git.repoPath p <- liftIO $ relPathCwdToFile top- let logfile = p </> locationLogFile key+ config <- Annex.getGitConfig+ let logfile = p </> locationLogFile config key inRepo $ pipeNullSplitZombie $ [ Params "log -z --pretty=format:%ct --raw --abbrev=40" , Param "--remove-empty"
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex-shell command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -62,8 +62,7 @@ oksize <- case Types.Key.keySize key of Nothing -> return True Just size -> do- size' <- fromIntegral . fileSize- <$> liftIO (getFileStatus tmp)+ size' <- liftIO $ getFileSize tmp return $ size == size' if oksize then case Backend.maybeLookupBackendName (Types.Key.keyBackendName key) of
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010,2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010,2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -70,7 +70,7 @@ | not (isSymbolicLink s) = checkkey s =<< catKeyFile f | otherwise = Just <$> checkNew f - checkkey s (Just k) = ifM (sameFileStatus k s)+ checkkey s (Just k) = ifM (sameFileStatus k f s) ( return Nothing , return $ Just ModifiedFile )
@@ -1,7 +1,7 @@ {- git-annex command - - Copyright 2011 Joachim Breitner <mail@joachim-breitner.de>- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -52,11 +52,17 @@ seek SectionCommon "synchronize local repository with remotes"] syncOptions :: [Option]-syncOptions = [ contentOption ]+syncOptions =+ [ contentOption+ , messageOption+ ] contentOption :: Option contentOption = flagOption [] "content" "also transfer file contents" +messageOption :: Option+messageOption = fieldOption ['m'] "message" "MSG" "specify commit message"+ seek :: CommandSeek seek rs = do prepMerge@@ -139,6 +145,8 @@ commit :: CommandStart commit = next $ next $ do+ commitmessage <- fromMaybe "git-annex automatic sync"+ <$> Annex.getField (optionName messageOption) showStart "commit" "" Annex.Branch.commit "update" ifM isDirect@@ -154,8 +162,6 @@ ] return True )- where- commitmessage = "git-annex automatic sync" commitStaged :: Git.Branch.CommitMode -> String -> Annex Bool commitStaged commitmode commitmessage = go =<< inRepo Git.Branch.currentUnsafe
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex plumbing command (for use by old assistant, and users) -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command, used internally by assistant -- - Copyright 2012, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010, 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010, 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex watch command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex webapp launcher -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -11,6 +11,7 @@ import Data.List as X hiding (head, tail, init, last) import Data.String.Utils as X hiding (join) import Data.Monoid as X+import Data.Default as X import System.FilePath as X import System.Directory as X@@ -30,7 +31,8 @@ import Utility.Data as X import Utility.Applicative as X import Utility.FileSystemEncoding as X-import Utility.PosixFiles as X+import Utility.PosixFiles as X hiding (fileSize)+import Utility.FileSize as X import Utility.Network as X import Utility.PartialPrelude as X
@@ -1,6 +1,6 @@ {- Git configuration -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -23,7 +23,7 @@ {- Looks up a setting in git config. -} getConfig :: ConfigKey -> String -> Annex String-getConfig (ConfigKey key) def = fromRepo $ Git.Config.get key def+getConfig (ConfigKey key) d = fromRepo $ Git.Config.get key d getConfigMaybe :: ConfigKey -> Annex (Maybe String) getConfigMaybe (ConfigKey key) = fromRepo $ Git.Config.getMaybe key@@ -58,7 +58,7 @@ - by remote.<name>.annex-cost, or if remote.<name>.annex-cost-command - is set and prints a number, that is used. -} remoteCost :: RemoteGitConfig -> Cost -> Annex Cost-remoteCost c def = fromMaybe def <$> remoteCost' c+remoteCost c d = fromMaybe d <$> remoteCost' c remoteCost' :: RemoteGitConfig -> Annex (Maybe Cost) remoteCost' c = case remoteAnnexCostCommand c of
@@ -1,6 +1,6 @@ {- Remote costs. -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex extra config files -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex numcopies configuration -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Credentials storage -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -3,7 +3,7 @@ - Currently using gpg; could later be modified to support different - crypto backends if neccessary. -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -3,7 +3,7 @@ - This is written to be completely independant of git-annex and should be - suitable for other uses. -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git autocorrection using Damerau-Levenshtein edit distance -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git branch stuff -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git build version -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git cat-file interface -- - Copyright 2011, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git check-attr interface -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git check-ignore interface -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- running git commands -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- running batch git commands -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git repository configuration handling -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Construction of Git Repo objects -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- The current git repository. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git diff-tree interface -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git diff-tree item -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git file modes -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -5,7 +5,7 @@ - top of the repository even when run in a subdirectory. Adding some - types helps keep that straight. -- - Copyright 2012-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,7 +1,7 @@ {- Some git commands output encoded filenames, in a rather annoyingly complex - C-style encoding. -- - Copyright 2010, 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2010, 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git fsck interface -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -2,7 +2,7 @@ - - https://github.com/blake2-ppc/git-remote-gcrypt -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git hash-object interface -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,15 +1,20 @@ {- git hooks -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013-2015 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} +{-# LANGUAGE CPP #-}+ module Git.Hook where import Common import Git import Utility.Tmp+#ifndef mingw32_HOST_OS+import Utility.FileMode+#endif data Hook = Hook { hookName :: FilePath@@ -56,3 +61,37 @@ expectedContent h r = do content <- readFile $ hookFile h r return $ content == hookScript h++hookExists :: Hook -> Repo -> IO Bool+hookExists h r = do+ let f = hookFile h r+ catchBoolIO $+#ifndef mingw32_HOST_OS+ isExecutable . fileMode <$> getFileStatus f+#else+ doesFileExist f+#endif++runHook :: Hook -> Repo -> IO Bool+runHook h r = do+ let f = hookFile h r+ (c, ps) <- findcmd f+ boolSystem c ps+ where+#ifndef mingw32_HOST_OS+ findcmd = defcmd+#else+ {- Like msysgit, parse the first line of the hook file,+ - look for "#!", and dispatch the interpreter on the file. -}+ findcmd f = do+ l <- headMaybe . lines <$> catchDefaultIO "" (readFile f)+ case l of+ Just ('#':'!':rest) -> case words rest of+ [] -> defcmd f+ (c:ps) -> do+ let ps' = map Param (ps ++ [f])+ ok <- inPath c+ return (if ok then c else takeFileName c, ps')+ _ -> defcmd f+#endif+ defcmd f = return (f, [])
@@ -1,6 +1,6 @@ {- git index file stuff -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git ls-files interface -- - Copyright 2010,2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010,2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git ls-tree interface -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git merging -- - Copyright 2012, 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012, 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- .git/objects -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git repository command queue -- - Copyright 2010,2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010,2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git ref stuff -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git reflog interface -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git remote stuff -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git remote stuff -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git repository recovery -- - Copyright 2013-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2013-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git SHA stuff -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git core.sharedRepository handling -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git data types -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-union-merge library -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-update-index library -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git repository urls -- - Copyright 2010, 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2010, 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git versions -- - Copyright 2011, 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011, 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- user-specified limits on files to act on -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -239,9 +239,7 @@ checkkey sz key = return $ keySize key `vs` Just sz check _ sz (Just key) = checkkey sz key check fi sz Nothing = do- filesize <- liftIO $ catchMaybeIO $- fromIntegral . fileSize- <$> getFileStatus (relFile fi)+ filesize <- liftIO $ catchMaybeIO $ getFileSize (relFile fi) return $ filesize `vs` Just sz addMetaData :: String -> Annex ()
@@ -1,6 +1,6 @@ {- git-annex limits by wanted status -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex file locations -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2015 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -20,7 +20,6 @@ gitAnnexInodeSentinal, gitAnnexInodeSentinalCache, annexLocations,- annexLocation, gitAnnexDir, gitAnnexObjectDir, gitAnnexTmpMiscDir,@@ -59,7 +58,7 @@ gitAnnexRemotesDir, gitAnnexAssistantDefaultDir, isLinkToAnnex,- annexHashes,+ HashLevels(..), hashDirMixed, hashDirLower, preSanitizeKeyName,@@ -67,16 +66,16 @@ prop_idempotent_fileKey ) where -import Data.Bits-import Data.Word-import Data.Hash.MD5 import Data.Char+import Data.Default import Common-import Types+import Types.GitConfig import Types.Key import Types.UUID+import Types.Difference import qualified Git+import Annex.DirHashes {- Conventions: -@@ -102,12 +101,16 @@ objectDir = addTrailingPathSeparator $ annexDir </> "objects" {- Annexed file's possible locations relative to the .git directory.- - There are two different possibilities, using different hashes. -}-annexLocations :: Key -> [FilePath]-annexLocations key = map (annexLocation key) annexHashes-annexLocation :: Key -> Hasher -> FilePath-annexLocation key hasher = objectDir </> keyPath key hasher+ - There are two different possibilities, using different hashes.+ -+ - Also, some repositories have a Difference in hash directory depth.+ -}+annexLocations :: GitConfig -> Key -> [FilePath]+annexLocations config key = map (annexLocation config key) dirHashes +annexLocation :: GitConfig -> Key -> (HashLevels -> Hasher) -> FilePath+annexLocation config key hasher = objectDir </> keyPath key (hasher $ objectHashLevels config)+ {- Annexed object's location in a repository. - - When there are multiple possible locations, returns the one where the@@ -120,32 +123,37 @@ - the actual location of the file's content. -} gitAnnexLocation :: Key -> Git.Repo -> GitConfig -> IO FilePath-gitAnnexLocation key r config = gitAnnexLocation' key r (annexCrippledFileSystem config)-gitAnnexLocation' :: Key -> Git.Repo -> Bool -> IO FilePath-gitAnnexLocation' key r crippled+gitAnnexLocation key r config = gitAnnexLocation' key r config (annexCrippledFileSystem config)+gitAnnexLocation' :: Key -> Git.Repo -> GitConfig -> Bool -> IO FilePath+gitAnnexLocation' key r config crippled {- Bare repositories default to hashDirLower for new - content, as it's more portable. - - Repositories on filesystems that are crippled also use - hashDirLower, since they do not use symlinks and it's- - more portable. -}- | Git.repoIsLocalBare r || crippled =- check $ map inrepo $ annexLocations key+ - more portable.+ -+ - ObjectHashLower can also be set to force it.+ -}+ | Git.repoIsLocalBare r + || crippled + || hasDifference ObjectHashLower (annexDifferences config) =+ check $ map inrepo $ annexLocations config key {- Non-bare repositories only use hashDirMixed, so - don't need to do any work to check if the file is - present. -}- | otherwise = return $ inrepo $ annexLocation key hashDirMixed+ | otherwise = return $ inrepo $ annexLocation config key hashDirMixed where inrepo d = Git.localGitDir r </> d check locs@(l:_) = fromMaybe l <$> firstM doesFileExist locs check [] = error "internal" {- Calculates a symlink to link a file to an annexed object. -}-gitAnnexLink :: FilePath -> Key -> Git.Repo -> IO FilePath-gitAnnexLink file key r = do+gitAnnexLink :: FilePath -> Key -> Git.Repo -> GitConfig -> IO FilePath+gitAnnexLink file key r config = do currdir <- getCurrentDirectory let absfile = fromMaybe whoops $ absNormPathUnix currdir file- loc <- gitAnnexLocation' key r False+ loc <- gitAnnexLocation' key r config False relPathDirToFile (parentDir absfile) loc where whoops = error $ "unable to normalize " ++ file@@ -399,9 +407,9 @@ where k = stubKey { keyName = s, keyBackendName = "test" } -{- A location to store a key on the filesystem. A directory hash is used,- - to protect against filesystems that dislike having many items in a- - single directory.+{- A location to store a key on a special remote that uses a filesystem.+ - A directory hash is used, to protect against filesystems that dislike+ - having many items in a single directory. - - The file is put in a directory with the same name, this allows - write-protecting the directory to avoid accidental deletion of the file.@@ -411,44 +419,11 @@ where f = keyFile key -{- All possibile locations to store a key using different directory hashes. -}-keyPaths :: Key -> [FilePath]-keyPaths key = map (keyPath key) annexHashes--{- Two different directory hashes may be used. The mixed case hash- - came first, and is fine, except for the problem of case-strict- - filesystems such as Linux VFAT (mounted with shortname=mixed),- - which do not allow using a directory "XX" when "xx" already exists.- - To support that, most repositories use the lower case hash for new data. -}-type Hasher = Key -> FilePath--annexHashes :: [Hasher]-annexHashes = [hashDirLower, hashDirMixed]--hashDirMixed :: Hasher-hashDirMixed k = addTrailingPathSeparator $ take 2 dir </> drop 2 dir- where- dir = take 4 $ display_32bits_as_dir =<< [a,b,c,d]- ABCD (a,b,c,d) = md5 $ md5FilePath $ key2file $ nonChunkKey k--hashDirLower :: Hasher-hashDirLower k = addTrailingPathSeparator $ take 3 dir </> drop 3 dir- where- dir = take 6 $ md5s $ md5FilePath $ key2file $ nonChunkKey k--{- modified version of display_32bits_as_hex from Data.Hash.MD5- - Copyright (C) 2001 Ian Lynagh - - License: Either BSD or GPL+{- All possibile locations to store a key in a special remote+ - using different directory hashes.+ -+ - This is compatible with the annexLocations, for interoperability between+ - special remotes and git-annex repos. -}-display_32bits_as_dir :: Word32 -> String-display_32bits_as_dir w = trim $ swap_pairs cs- where - -- Need 32 characters to use. To avoid inaverdently making- -- a real word, use letters that appear less frequently.- chars = ['0'..'9'] ++ "zqjxkmvwgpfZQJXKMVWGPF"- cs = map (\x -> getc $ (shiftR w (6*x)) .&. 31) [0..7]- getc n = chars !! fromIntegral n- swap_pairs (x1:x2:xs) = x2:x1:swap_pairs xs- swap_pairs _ = []- -- Last 2 will always be 00, so omit.- trim = take 6+keyPaths :: Key -> [FilePath]+keyPaths key = map (\h -> keyPath key (h def)) dirHashes
@@ -1,6 +1,6 @@ {- git-annex log file names -- - Copyright 2013-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2013-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -9,6 +9,7 @@ import Common.Annex import Types.Key+import Annex.DirHashes {- There are several varieties of log file formats. -} data LogVariety@@ -39,6 +40,7 @@ , preferredContentLog , requiredContentLog , scheduleLog+ , differenceLog ] {- All the ways to get a key from a presence log file -}@@ -82,9 +84,12 @@ scheduleLog :: FilePath scheduleLog = "schedule.log" +differenceLog :: FilePath+differenceLog = "difference.log"+ {- The pathname of the location log file for a given key. -}-locationLogFile :: Key -> String-locationLogFile key = hashDirLower key ++ keyFile key ++ ".log"+locationLogFile :: GitConfig -> Key -> String+locationLogFile config key = branchHashDir config key </> keyFile key ++ ".log" {- Converts a pathname into a key if it's a location log. -} locationLogFileKey :: FilePath -> Maybe Key@@ -97,15 +102,17 @@ (base, ext) = splitAt (length file - 4) file {- The filename of the url log for a given key. -}-urlLogFile :: Key -> FilePath-urlLogFile key = hashDirLower key </> keyFile key ++ urlLogExt+urlLogFile :: GitConfig -> Key -> FilePath+urlLogFile config key = branchHashDir config key </> keyFile key ++ urlLogExt {- Old versions stored the urls elsewhere. -}-oldurlLogs :: Key -> [FilePath]-oldurlLogs key =- [ "remote/web" </> hashDirLower key </> key2file key ++ ".log"- , "remote/web" </> hashDirLower key </> keyFile key ++ ".log"+oldurlLogs :: GitConfig -> Key -> [FilePath]+oldurlLogs config key =+ [ "remote/web" </> hdir </> key2file key ++ ".log"+ , "remote/web" </> hdir </> keyFile key ++ ".log" ]+ where+ hdir = branchHashDir config key urlLogExt :: String urlLogExt = ".log.web"@@ -126,8 +133,9 @@ isUrlLog file = urlLogExt `isSuffixOf` file {- The filename of the remote state log for a given key. -}-remoteStateLogFile :: Key -> FilePath-remoteStateLogFile key = hashDirLower key </> keyFile key ++ remoteStateLogExt+remoteStateLogFile :: GitConfig -> Key -> FilePath+remoteStateLogFile config key = branchHashDir config key + </> keyFile key ++ remoteStateLogExt remoteStateLogExt :: String remoteStateLogExt = ".log.rmt"@@ -136,8 +144,8 @@ isRemoteStateLog path = remoteStateLogExt `isSuffixOf` path {- The filename of the chunk log for a given key. -}-chunkLogFile :: Key -> FilePath-chunkLogFile key = hashDirLower key </> keyFile key ++ chunkLogExt+chunkLogFile :: GitConfig -> Key -> FilePath+chunkLogFile config key = branchHashDir config key </> keyFile key ++ chunkLogExt chunkLogFileKey :: FilePath -> Maybe Key chunkLogFileKey path@@ -155,35 +163,11 @@ isChunkLog path = chunkLogExt `isSuffixOf` path {- The filename of the metadata log for a given key. -}-metaDataLogFile :: Key -> FilePath-metaDataLogFile key = hashDirLower key </> keyFile key ++ metaDataLogExt+metaDataLogFile :: GitConfig -> Key -> FilePath+metaDataLogFile config key = branchHashDir config key </> keyFile key ++ metaDataLogExt metaDataLogExt :: String metaDataLogExt = ".log.met" isMetaDataLog :: FilePath -> Bool isMetaDataLog path = metaDataLogExt `isSuffixOf` path--prop_logs_sane :: Key -> Bool-prop_logs_sane dummykey = and- [ isNothing (getLogVariety "unknown")- , expect gotUUIDBasedLog (getLogVariety uuidLog)- , expect gotPresenceLog (getLogVariety $ locationLogFile dummykey)- , expect gotPresenceLog (getLogVariety $ urlLogFile dummykey)- , expect gotNewUUIDBasedLog (getLogVariety $ remoteStateLogFile dummykey)- , expect gotChunkLog (getLogVariety $ chunkLogFile dummykey)- , expect gotOtherLog (getLogVariety $ metaDataLogFile dummykey)- , expect gotOtherLog (getLogVariety numcopiesLog)- ]- where- expect = maybe False- gotUUIDBasedLog UUIDBasedLog = True- gotUUIDBasedLog _ = False- gotNewUUIDBasedLog NewUUIDBasedLog = True- gotNewUUIDBasedLog _ = False- gotChunkLog (ChunkLog k) = k == dummykey- gotChunkLog _ = False- gotPresenceLog (PresenceLog k) = k == dummykey- gotPresenceLog _ = False- gotOtherLog OtherLog = True- gotOtherLog _ = False
@@ -10,7 +10,7 @@ - - Format: "timestamp uuid:chunksize chunkcount" -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -29,6 +29,7 @@ import Logs.MapLog import qualified Annex.Branch import Logs.Chunk.Pure+import qualified Annex import qualified Data.Map as M import Data.Time.Clock.POSIX@@ -36,14 +37,17 @@ chunksStored :: UUID -> Key -> ChunkMethod -> ChunkCount -> Annex () chunksStored u k chunkmethod chunkcount = do ts <- liftIO getPOSIXTime- Annex.Branch.change (chunkLogFile k) $+ config <- Annex.getGitConfig+ Annex.Branch.change (chunkLogFile config k) $ showLog . changeMapLog ts (u, chunkmethod) chunkcount . parseLog chunksRemoved :: UUID -> Key -> ChunkMethod -> Annex () chunksRemoved u k chunkmethod = chunksStored u k chunkmethod 0 getCurrentChunks :: UUID -> Key -> Annex [(ChunkMethod, ChunkCount)]-getCurrentChunks u k = select . parseLog <$> Annex.Branch.get (chunkLogFile k)+getCurrentChunks u k = do+ config <- Annex.getGitConfig+ select . parseLog <$> Annex.Branch.get (chunkLogFile config k) where select = filter (\(_m, ct) -> ct > 0) . map (\((_ku, m), l) -> (m, value l))
@@ -1,6 +1,6 @@ {- Chunk logs, pure operations. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -0,0 +1,41 @@+{- git-annex difference log+ -+ - Copyright 2015 Joey Hess <id@joeyh.name>+ -+ - Licensed under the GNU GPL version 3 or higher.+ -}++module Logs.Difference (+ recordDifferences,+ recordedDifferences,+ recordedDifferencesFor,+ module Logs.Difference.Pure+) where++import Data.Monoid+import Data.Time.Clock.POSIX+import qualified Data.Map as M++import Common.Annex+import Types.Difference+import qualified Annex.Branch+import Logs+import Logs.UUIDBased+import Logs.Difference.Pure++recordDifferences :: Differences -> UUID -> Annex ()+recordDifferences (Differences differences) uuid = do+ ts <- liftIO getPOSIXTime+ Annex.Branch.change differenceLog $+ showLog id . changeLog ts uuid (show differences) . parseLog Just+recordDifferences UnknownDifferences _ = return ()++-- Map of UUIDs that have Differences recorded.+-- If a new version of git-annex has added a Difference this version+-- doesn't know about, it will contain UnknownDifferences.+recordedDifferences :: Annex (M.Map UUID Differences)+recordedDifferences = parseDifferencesLog <$> Annex.Branch.get differenceLog++recordedDifferencesFor :: UUID -> Annex Differences+recordedDifferencesFor u = fromMaybe mempty . M.lookup u + <$> recordedDifferences
@@ -0,0 +1,25 @@+{- git-annex difference log, pure functions+ -+ - Copyright 2015 Joey Hess <id@joeyh.name>+ -+ - Licensed under the GNU GPL version 3 or higher.+ -}++module Logs.Difference.Pure (+ allDifferences,+ parseDifferencesLog,+) where++import Data.Monoid+import qualified Data.Map as M++import Common.Annex+import Types.Difference+import Logs.UUIDBased++parseDifferencesLog :: String -> (M.Map UUID Differences)+parseDifferencesLog = simpleMap . parseLog (Just . readDifferences)++-- The sum of all recorded differences, across all UUIDs.+allDifferences :: M.Map UUID Differences -> Differences+allDifferences = mconcat . M.elems
@@ -1,6 +1,6 @@ {- git-annex fsck results log files -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex group log -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -8,7 +8,7 @@ - Repositories record their UUID and the date when they --get or --drop - a value. - - - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -29,6 +29,7 @@ import Logs.Presence import Annex.UUID import Git.Types (RefDate)+import qualified Annex {- Log a change in the presence of a key's value in current repository. -} logStatus :: Key -> LogStatus -> Annex ()@@ -38,7 +39,9 @@ {- Log a change in the presence of a key's value in a repository. -} logChange :: Key -> UUID -> LogStatus -> Annex ()-logChange key (UUID u) s = addLog (locationLogFile key) =<< logNow s u+logChange key (UUID u) s = do+ config <- Annex.getGitConfig+ addLog (locationLogFile config key) =<< logNow s u logChange _ NoUUID _ = noop {- Returns a list of repository UUIDs that, according to the log, have@@ -51,7 +54,9 @@ loggedLocationsHistorical = getLoggedLocations . historicalLog getLoggedLocations :: (FilePath -> Annex [String]) -> Key -> Annex [UUID]-getLoggedLocations getter key = map toUUID <$> (getter . locationLogFile) key+getLoggedLocations getter key = do+ config <- Annex.getGitConfig+ map toUUID <$> (getter . locationLogFile config) key {- Finds all keys that have location log information. - (There may be duplicate keys in the list.) -}
@@ -4,7 +4,7 @@ - - A line of the log will look like: "timestamp field value" -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -18,7 +18,7 @@ - and so foo currently has no value. - -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -38,6 +38,7 @@ import Types.MetaData import Annex.MetaData.StandardFields import qualified Annex.Branch+import qualified Annex import Logs import Logs.SingleValue @@ -52,7 +53,9 @@ deserialize = Types.MetaData.deserialize getMetaDataLog :: Key -> Annex (Log MetaData)-getMetaDataLog = readLog . metaDataLogFile+getMetaDataLog key = do+ config <- Annex.getGitConfig+ readLog $ metaDataLogFile config key {- Go through the log from oldest to newest, and combine it all - into a single MetaData representing the current state.@@ -97,10 +100,12 @@ addMetaData' :: Key -> MetaData -> POSIXTime -> Annex () addMetaData' k d@(MetaData m) now | d == emptyMetaData = noop- | otherwise = Annex.Branch.change (metaDataLogFile k) $- showLog . simplifyLog - . S.insert (LogEntry now metadata)- . parseLog+ | otherwise = do+ config <- Annex.getGitConfig+ Annex.Branch.change (metaDataLogFile config k) $+ showLog . simplifyLog + . S.insert (LogEntry now metadata)+ . parseLog where metadata = MetaData $ M.filterWithKey (\f _ -> not (isLastChangedField f)) m @@ -181,6 +186,7 @@ | oldkey == newkey = noop | otherwise = do l <- getMetaDataLog oldkey- unless (S.null l) $- Annex.Branch.change (metaDataLogFile newkey) $+ unless (S.null l) $ do+ config <- Annex.getGitConfig+ Annex.Branch.change (metaDataLogFile config newkey) $ const $ showLog l
@@ -1,6 +1,6 @@ {- git-annex numcopies log -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex preferred content matcher configuration -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -52,12 +52,12 @@ isRequiredContent = checkMap requiredContentMap checkMap :: Annex (FileMatcherMap Annex) -> Maybe UUID -> AssumeNotPresent -> Maybe Key -> AssociatedFile -> Bool -> Annex Bool-checkMap getmap mu notpresent mkey afile def = do+checkMap getmap mu notpresent mkey afile d = do u <- maybe getUUID return mu m <- getmap case M.lookup u m of- Nothing -> return def- Just matcher -> checkMatcher matcher mkey afile notpresent def+ Nothing -> return d+ Just matcher -> checkMatcher matcher mkey afile notpresent d preferredContentMap :: Annex (FileMatcherMap Annex) preferredContentMap = maybe (fst <$> preferredRequiredMapsLoad) return
@@ -1,6 +1,6 @@ {- unparsed preferred content expressions -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -6,7 +6,7 @@ - A line of the log will look like: "date N INFO" - Where N=1 when the INFO is present, and 0 otherwise. - - - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex presence log, pure operations -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex remote log - - - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Remote state logs. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -14,6 +14,7 @@ import Logs import Logs.UUIDBased import qualified Annex.Branch+import qualified Annex import qualified Data.Map as M import Data.Time.Clock.POSIX@@ -23,11 +24,14 @@ setRemoteState :: UUID -> Key -> RemoteState -> Annex () setRemoteState u k s = do ts <- liftIO getPOSIXTime- Annex.Branch.change (remoteStateLogFile k) $+ config <- Annex.getGitConfig+ Annex.Branch.change (remoteStateLogFile config k) $ showLogNew id . changeLog ts u s . parseLogNew Just getRemoteState :: UUID -> Key -> Annex (Maybe RemoteState)-getRemoteState u k = extract . parseLogNew Just- <$> Annex.Branch.get (remoteStateLogFile k)+getRemoteState u k = do+ config <- Annex.getGitConfig+ extract . parseLogNew Just+ <$> Annex.Branch.get (remoteStateLogFile config k) where extract m = value <$> M.lookup u m
@@ -1,6 +1,6 @@ {- git-annex scheduled activities log -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -6,7 +6,7 @@ - - The line with the newest timestamp wins. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex transfer information files and lock files -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -7,7 +7,7 @@ - done that is listed in the remote branch by checking that the local - branch contains the same transition, with the same or newer start time. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex trust log -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex trust log, basics -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex trust log, pure operations -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -8,7 +8,7 @@ - - uuid.log stores a list of known uuids, and their descriptions. -- - Copyright 2010-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -9,7 +9,7 @@ - - New uuid based logs instead use the form: "timestamp UUID INFO" - - - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -10,7 +10,7 @@ - The timestamp indicates when the key was first determined to be unused. - Older versions of the log omit the timestamp. -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -4,7 +4,7 @@ - - This file is stored locally in .git/annex/, not in the git-annex branch. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Web url logs. -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -37,7 +37,8 @@ {- Gets all urls that a key might be available from. -} getUrls :: Key -> Annex [URLString] getUrls key = do- l <- go $ urlLogFile key : oldurlLogs key+ config <- Annex.getGitConfig+ l <- go $ urlLogFile config key : oldurlLogs config key tmpl <- Annex.getState (maybeToList . M.lookup key . Annex.tempurls) return (tmpl ++ l) where@@ -54,13 +55,15 @@ setUrlPresent :: UUID -> Key -> URLString -> Annex () setUrlPresent uuid key url = do us <- getUrls key- unless (url `elem` us) $- addLog (urlLogFile key) =<< logNow InfoPresent url+ unless (url `elem` us) $ do+ config <- Annex.getGitConfig+ addLog (urlLogFile config key) =<< logNow InfoPresent url logChange key uuid InfoPresent setUrlMissing :: UUID -> Key -> URLString -> Annex () setUrlMissing uuid key url = do- addLog (urlLogFile key) =<< logNow InfoMissing url+ config <- Annex.getGitConfig+ addLog (urlLogFile config key) =<< logNow InfoMissing url whenM (null <$> getUrls key) $ logChange key uuid InfoMissing
@@ -1,6 +1,6 @@ {- git-annex output messages -- - Copyright 2010-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex JSON output -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex remotes -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -131,8 +131,8 @@ byNameOrGroup n = go =<< getConfigMaybe (ConfigKey ("remotes." ++ n)) where go (Just l) = concatMap maybeToList <$>- mapM (Remote.byName . Just) (split " " l)- go Nothing = maybeToList <$> Remote.byName (Just n)+ mapM (byName . Just) (split " " l)+ go Nothing = maybeToList <$> byName (Just n) {- Only matches remote name, not UUID -} byNameOnly :: RemoteName -> Annex (Maybe Remote)@@ -272,15 +272,17 @@ return (sortBy (comparing cost) validremotes, validtrusteduuids) {- Displays known locations of a key. -}-showLocations :: Key -> [UUID] -> String -> Annex ()-showLocations key exclude nolocmsg = do+showLocations :: Bool -> Key -> [UUID] -> String -> Annex ()+showLocations separateuntrusted key exclude nolocmsg = do u <- getUUID uuids <- keyLocations key- untrusteduuids <- trustGet UnTrusted+ untrusteduuids <- if separateuntrusted+ then trustGet UnTrusted+ else pure [] let uuidswanted = filteruuids uuids (u:exclude++untrusteduuids) let uuidsskipped = filteruuids uuids (u:exclude++uuidswanted)- ppuuidswanted <- Remote.prettyPrintUUIDs "wanted" uuidswanted- ppuuidsskipped <- Remote.prettyPrintUUIDs "skipped" uuidsskipped+ ppuuidswanted <- prettyPrintUUIDs "wanted" uuidswanted+ ppuuidsskipped <- prettyPrintUUIDs "skipped" uuidsskipped showLongNote $ message ppuuidswanted ppuuidsskipped ignored <- filter (remoteAnnexIgnore . gitconfig) <$> remoteList unless (null ignored) $
@@ -1,6 +1,6 @@ {- BitTorrent remote. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Using bup as a remote. -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Using ddar as a remote. Based on bup and rsync remotes. -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - Copyright 2014 Robie Basak <robie@justgohome.co.uk> - - Licensed under the GNU GPL version 3 or higher.@@ -12,7 +12,6 @@ import qualified Data.ByteString.Lazy as L import System.IO.Error -import Data.String.Utils import Common.Annex import Types.Remote import Types.Key@@ -164,7 +163,7 @@ ExitSuccess -> return $ Right True ExitFailure 1 -> return $ Right False ExitFailure code -> return $ Left $ "ssh call " ++- show (Data.String.Utils.join " " $ toCommand params) +++ show (unwords $ toCommand params) ++ " failed with status " ++ show code where (host, ddarrepo') = splitRemoteDdarRepo ddarrepo
@@ -1,6 +1,6 @@ {- A "remote" that is just a filesystem directory. -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -15,6 +15,7 @@ import qualified Data.ByteString.Lazy as L import qualified Data.Map as M+import Data.Default import Common.Annex import Types.Remote@@ -107,7 +108,7 @@ {- Directory where the file(s) for a key are stored. -} storeDir :: FilePath -> Key -> FilePath-storeDir d k = addTrailingPathSeparator $ d </> hashDirLower k </> keyFile k+storeDir d k = addTrailingPathSeparator $ d </> hashDirLower def k </> keyFile k {- Where we store temporary data for a key, in the directory, as it's being - written. -}
@@ -2,7 +2,7 @@ - - Can be removed eventually. -- - Copyright 2011-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- External special remote interface. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -184,7 +184,7 @@ handleRemoteRequest (PROGRESS bytesprocessed) = maybe noop (\a -> liftIO $ a bytesprocessed) mp handleRemoteRequest (DIRHASH k) = - send $ VALUE $ hashDirMixed k+ send $ VALUE $ hashDirMixed def k handleRemoteRequest (SETCONFIG setting value) = liftIO $ atomically $ do let v = externalConfig external
@@ -1,6 +1,6 @@ {- External special remote data types. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git remotes encrypted using git-remote-gcrypt -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -16,6 +16,7 @@ import qualified Data.Map as M import qualified Data.ByteString.Lazy as L import Control.Exception+import Data.Default import Common.Annex import Types.Remote@@ -121,7 +122,7 @@ , availability = availabilityCalc r , remotetype = remote , mkUnavailable = return Nothing- , getInfo = return $ gitRepoInfo r+ , getInfo = gitRepoInfo this , claimUrl = Nothing , checkUrl = Nothing }@@ -361,7 +362,7 @@ {- Annexed objects are hashed using lower-case directories for max - portability. -} gCryptLocation :: Remote -> Key -> FilePath-gCryptLocation r key = Git.repoLocation (repo r) </> objectDir </> keyPath key hashDirLower+gCryptLocation r key = Git.repoLocation (repo r) </> objectDir </> keyPath key (hashDirLower def) data AccessMethod = AccessDirect | AccessShell
@@ -1,6 +1,6 @@ {- Standard git remotes. -- - Copyright 2011-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -159,7 +159,7 @@ , availability = availabilityCalc r , remotetype = remote , mkUnavailable = unavailable r u c gc- , getInfo = return $ gitRepoInfo r+ , getInfo = gitRepoInfo new , claimUrl = Nothing , checkUrl = Nothing }@@ -327,13 +327,15 @@ -- If the remote is known to not be bare, try the hash locations -- used for non-bare repos first, as an optimisation. locs- | remoteAnnexBare (gitconfig r) == Just False = reverse (annexLocations key)- | otherwise = annexLocations key+ | remoteAnnexBare remoteconfig == Just False = reverse (annexLocations cfg key)+ | otherwise = annexLocations cfg key #ifndef mingw32_HOST_OS locs' = locs #else locs' = map (replace "\\" "/") locs #endif+ remoteconfig = gitconfig r+ cfg = fromJust $ remoteGitConfig remoteconfig dropKey :: Remote -> Key -> Annex Bool dropKey r key@@ -563,9 +565,7 @@ (const $ copyFileExternal CopyTimeStamps src dest) watchfilesize oldsz = do threadDelay 500000 -- 0.5 seconds- v <- catchMaybeIO $- toBytesProcessed . fileSize- <$> getFileStatus dest+ v <- catchMaybeIO $ toBytesProcessed <$> getFileSize dest case v of Just sz | sz /= oldsz -> do
@@ -1,6 +1,6 @@ {- Amazon Glacier remotes. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Amazon Web Services common infrastructure. -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex chunked remotes -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -244,8 +244,7 @@ | otherwise = go =<< chunkKeys u chunkconfig basek where go ls = do- currsize <- liftIO $ catchMaybeIO $- toInteger . fileSize <$> getFileStatus dest+ currsize <- liftIO $ catchMaybeIO $ getFileSize dest let ls' = maybe ls (setupResume ls) currsize if any null ls' then return True -- dest is already complete
@@ -1,6 +1,6 @@ {- legacy git-annex chunked remotes -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- common functions for encryptable remotes -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Utilities for git remotes. -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -10,7 +10,10 @@ import Common.Annex import qualified Git import Types.Availability+import qualified Types.Remote as Remote +import Data.Time.Clock.POSIX+ repoCheap :: Git.Repo -> Bool repoCheap = not . Git.repoIsUrl @@ -31,7 +34,15 @@ | Git.repoIsLocalUnknown r = fallback | otherwise = a -gitRepoInfo :: Git.Repo -> [(String, String)]-gitRepoInfo r =- [ ("repository location", Git.repoLocation r)- ]+gitRepoInfo :: Remote -> Annex [(String, String)]+gitRepoInfo r = do+ d <- fromRepo Git.localGitDir+ mtimes <- liftIO $ mapM (modificationTime <$$> getFileStatus)+ =<< dirContentsRecursive (d </> "refs" </> "remotes" </> Remote.name r)+ let lastsynctime = case mtimes of+ [] -> "never"+ _ -> show $ posixSecondsToUTCTime $ realToFrac $ maximum mtimes+ return+ [ ("repository location", Git.repoLocation (Remote.repo r))+ , ("last synced", lastsynctime)+ ]
@@ -1,6 +1,6 @@ {- Adds hooks to remotes. -- - Copyright 2012 Joey Hess <joey@kitenet.net>+ - Copyright 2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- helpers for remotes using http -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -32,7 +32,7 @@ -- the meter as it's sent. httpBodyStorer :: FilePath -> MeterUpdate -> IO RequestBody httpBodyStorer src m = do- size <- fromIntegral . fileSize <$> getFileStatus src :: IO Integer+ size <- getFileSize src let streamer sink = withMeteredFile src m $ \b -> byteStringPopper b sink return $ RequestBodyStream (fromInteger size) streamer
@@ -1,6 +1,6 @@ {- git-annex remote messages -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Adds readonly support to remotes. -- - Copyright 2013 Joey Hess <joey@kitenet.net>+ - Copyright 2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- helpers for special remotes -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex remote access with ssh and git-annex-shell -- - Copyright 2011-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,14 +1,12 @@ {- A remote that provides hooks to run shell commands. -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} module Remote.Hook (remote) where -import qualified Data.Map as M- import Common.Annex import Types.Remote import Types.Key@@ -20,6 +18,8 @@ import Remote.Helper.Special import Utility.Env +import qualified Data.Map as M+ type Action = String type HookName = String @@ -90,7 +90,7 @@ ] fileenv Nothing = [] fileenv (Just file) = [envvar "FILE" file]- hashbits = map takeDirectory $ splitPath $ hashDirMixed k+ hashbits = map takeDirectory $ splitPath $ hashDirMixed def k lookupHook :: HookName -> Action -> Annex (Maybe String) lookupHook hookname action = do
@@ -2,7 +2,7 @@ {- git-annex remote list -- - Copyright 2011,2012 Joey Hess <joey@kitenet.net>+ - Copyright 2011,2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- A remote that is only accessible by rsync. -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -37,6 +37,7 @@ import Logs.Transfer import Types.Creds import Types.Key (isChunkKey)+import Annex.DirHashes import qualified Data.Map as M @@ -212,8 +213,8 @@ - content could be. Note that the parent directories have - to also be explicitly included, due to how rsync - traverses directories. -}- includes = concatMap use annexHashes- use h = let dir = h k in+ includes = concatMap use dirHashes+ use h = let dir = h def k in [ parentDir dir , dir -- match content directory and anything in it
@@ -1,6 +1,6 @@ {- Rsync urls. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -14,10 +14,12 @@ import Utility.Rsync import Utility.SafeCommand +import Data.Default import System.FilePath.Posix #ifdef mingw32_HOST_OS import Data.String.Utils #endif+import Annex.DirHashes type RsyncUrl = String @@ -35,12 +37,12 @@ | otherwise = u rsyncUrls :: RsyncOpts -> Key -> [RsyncUrl]-rsyncUrls o k = map use annexHashes+rsyncUrls o k = map use dirHashes where use h = rsyncUrl o </> hash h </> rsyncEscape o (f </> f) f = keyFile k #ifndef mingw32_HOST_OS- hash h = h k+ hash h = h def k #else- hash h = replace "\\" "/" (h k)+ hash h = replace "\\" "/" (h def k) #endif
@@ -1,6 +1,6 @@ {- S3 remotes -- - Copyright 2011-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -159,7 +159,7 @@ store r h = fileStorer $ \k f p -> do case partSize (hinfo h) of Just partsz | partsz > 0 -> do- fsz <- fromIntegral . fileSize <$> liftIO (getFileStatus f)+ fsz <- liftIO $ getFileSize f if fsz > partsz then multipartupload fsz partsz k f p else singlepartupload k f p
@@ -13,7 +13,7 @@ - - Tahoe has its own encryption, so git-annex's encryption is not used. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Web remote. -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- WebDAV remotes. -- - Copyright 2012-2014 Joey Hess <joey@kitenet.net>+ - Copyright 2012-2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- WebDAV locations. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -17,6 +17,7 @@ import System.FilePath.Posix -- for manipulating url paths import Network.Protocol.HTTP.DAV (inDAVLocation, DAVT) import Control.Monad.IO.Class (MonadIO)+import Data.Default #ifdef mingw32_HOST_OS import Data.String.Utils #endif@@ -33,9 +34,9 @@ keyDir k = addTrailingPathSeparator $ hashdir </> keyFile k where #ifndef mingw32_HOST_OS- hashdir = hashDirLower k+ hashdir = hashDirLower def k #else- hashdir = replace "\\" "/" (hashDirLower k)+ hashdir = replace "\\" "/" (hashDirLower def k) #endif keyLocation :: Key -> DavLocation
@@ -1,6 +1,6 @@ {- git-remote-daemon utilities -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-remote-daemon core -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -20,24 +20,25 @@ import Config import Annex.Ssh -import Control.Concurrent.Async import Control.Concurrent+import Control.Concurrent.Async+import Control.Concurrent.STM import Network.URI import qualified Data.Map as M runForeground :: IO () runForeground = do (readh, writeh) <- ioHandles- ichan <- newChan :: IO (Chan Consumed)- ochan <- newChan :: IO (Chan Emitted)+ ichan <- newTChanIO :: IO (TChan Consumed)+ ochan <- newTChanIO :: IO (TChan Emitted) let reader = forever $ do l <- hGetLine readh case parseMessage l of Nothing -> error $ "protocol error: " ++ l- Just cmd -> writeChan ichan cmd+ Just cmd -> atomically $ writeTChan ichan cmd let writer = forever $ do- msg <- readChan ochan+ msg <- atomically $ readTChan ochan hPutStrLn writeh $ unwords $ formatMessage msg hFlush writeh let controller = runController ichan ochan@@ -46,11 +47,11 @@ void $ tryIO $ reader `concurrently` writer `concurrently` controller -type RemoteMap = M.Map Git.Repo (IO (), Chan Consumed)+type RemoteMap = M.Map Git.Repo (IO (), TChan Consumed) -- Runs the transports, dispatching messages to them, and handling -- the main control messages.-runController :: Chan Consumed -> Chan Emitted -> IO ()+runController :: TChan Consumed -> TChan Emitted -> IO () runController ichan ochan = do h <- genTransportHandle m <- genRemoteMap h ochan@@ -58,7 +59,7 @@ go h False m where go h paused m = do- cmd <- readChan ichan+ cmd <- atomically $ readTChan ichan case cmd of RELOAD -> do h' <- updateTransportHandle h@@ -88,22 +89,28 @@ -- All remaining messages are sent to -- all Transports. msg -> do- unless paused $- forM_ chans (`writeChan` msg)+ unless paused $ atomically $+ forM_ chans (`writeTChan` msg) go h paused m where chans = map snd (M.elems m) startrunning m = forM_ (M.elems m) startrunning'- startrunning' (transport, _) = void $ async transport+ startrunning' (transport, c) = do+ -- drain any old control messages from the channel+ -- to avoid confusing the transport with them+ atomically $ drain c+ void $ async transport - broadcast msg m = forM_ (M.elems m) send+ drain c = maybe noop (const $ drain c) =<< tryReadTChan c+ + broadcast msg m = atomically $ forM_ (M.elems m) send where- send (_, c) = writeChan c msg+ send (_, c) = writeTChan c msg -- Generates a map with a transport for each supported remote in the git repo, -- except those that have annex.sync = false-genRemoteMap :: TransportHandle -> Chan Emitted -> IO RemoteMap+genRemoteMap :: TransportHandle -> TChan Emitted -> IO RemoteMap genRemoteMap h@(TransportHandle g _) ochan = M.fromList . catMaybes <$> mapM gen (Git.remotes g) where@@ -111,7 +118,7 @@ Git.Url u -> case M.lookup (uriScheme u) remoteTransports of Just transport | remoteAnnexSync (extractRemoteGitConfig r (Git.repoDescribe r)) -> do- ichan <- newChan :: IO (Chan Consumed)+ ichan <- newTChanIO :: IO (TChan Consumed) return $ Just ( r , (transport r (RemoteURI u) h ichan ochan, ichan)
@@ -1,6 +1,6 @@ {- git-remote-daemon transports -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-remote-daemon, git-annex-shell over ssh transport -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -18,7 +18,7 @@ import Git.Command import Utility.ThreadScheduler -import Control.Concurrent.Chan+import Control.Concurrent.STM import Control.Concurrent.Async transport :: Transport@@ -58,7 +58,7 @@ return $ either (either id id) id status - send msg = writeChan ochan msg+ send msg = atomically $ writeTChan ochan msg fetch = do send (SYNCING url)@@ -80,7 +80,7 @@ Nothing -> return Stopping handlecontrol = do- msg <- readChan ichan+ msg <- atomically $ readTChan ichan case msg of STOP -> return Stopping LOSTNET -> return Stopping
@@ -1,6 +1,6 @@ {- git-remote-daemon, git-annex-shell notifychanges protocol types -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-remote-daemon data types. -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -17,6 +17,7 @@ import Network.URI import Control.Concurrent+import Control.Concurrent.STM -- The URI of a remote is used to uniquely identify it (names change..) newtype RemoteURI = RemoteURI URI@@ -24,7 +25,7 @@ -- A Transport for a particular git remote consumes some messages -- from a Chan, and emits others to another Chan.-type Transport = RemoteRepo -> RemoteURI -> TransportHandle -> Chan Consumed -> Chan Emitted -> IO ()+type Transport = RemoteRepo -> RemoteURI -> TransportHandle -> TChan Consumed -> TChan Emitted -> IO () type RemoteRepo = Git.Repo type LocalRepo = Git.Repo
@@ -1,6 +1,6 @@ {- git-annex test suite -- - Copyright 2010-2013 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2013 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}@@ -38,7 +38,6 @@ import qualified Types.Backend import qualified Types.TrustLevel import qualified Types-import qualified Logs import qualified Logs.MapLog import qualified Logs.Trust import qualified Logs.Remote@@ -138,7 +137,6 @@ , testProperty "prop_idempotent_key_decode" Types.Key.prop_idempotent_key_decode , testProperty "prop_idempotent_shellEscape" Utility.SafeCommand.prop_idempotent_shellEscape , testProperty "prop_idempotent_shellEscape_multiword" Utility.SafeCommand.prop_idempotent_shellEscape_multiword- , testProperty "prop_logs_sane" Logs.prop_logs_sane , testProperty "prop_idempotent_configEscape" Logs.Remote.prop_idempotent_configEscape , testProperty "prop_parse_show_Config" Logs.Remote.prop_parse_show_Config , testProperty "prop_upFrom_basics" Utility.Path.prop_upFrom_basics
@@ -1,6 +1,6 @@ {- git-annex abstract data types -- - Copyright 2010 Joey Hess <joey@kitenet.net>+ - Copyright 2010 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex remote availability -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -2,7 +2,7 @@ - - Most things should not need this, using Types instead -- - Copyright 2010,2012 Joey Hess <joey@kitenet.net>+ - Copyright 2010,2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex BranchState data type -- - Copyright 2011 Joey Hess <joey@kitenet.net>+ - Copyright 2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- Enumeration of cleanup actions -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex command data types -- - Copyright 2010-2011 Joey Hess <joey@kitenet.net>+ - Copyright 2010-2011 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- credentials -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex crypto types -- - Copyright 2011-2012 Joey Hess <joey@kitenet.net>+ - Copyright 2011-2012 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
@@ -1,6 +1,6 @@ {- git-annex DesktopNotify type -- - Copyright 2014 Joey Hess <joey@kitenet.net>+ - Copyright 2014 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -}
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff
file too large to diff