tests/test-lfs.t
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 03 Feb 2018 21:26:12 -0500
changeset 35962 0b79f99fd7b0
parent 35807 4425790f2373
child 36029 eefb5d603482
permissions -rw-r--r--
lfs: prefetch lfs blobs when applying merge updates In addition to merge, this method ultimately gets called by many commands: - backout - bisect - clone - fetch - graft - import (without --bypass) - pull -u - rebase - strip - share - transplant - unbundle - update Additionally, it's also called by histedit, shelve, unshelve, and split, but it seems that the related blobs should always be available locally for these. For `hg update`, it happens after the normal argument checking and pre-update hook processing, and remote corruption is detected prior to manipulating the working directory. Other commands could use this treatment (archive, cat, revert, etc), but this covers so many of the frequently used bulk commands, it seems like a good starting point. Losing the verbose message that prints the file name before a corrupt blob aborts the command is a little sad, because there's no easy way to go from oid to file name. I'd like to change that message to list the file name so it looks cleaner and less cryptic, but the pointer object is nowhere near where it needs to be to do this. So punt on that for now.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     1
# Initial setup
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     3
  $ cat >> $HGRCPATH << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     4
  > [extensions]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     5
  > lfs=
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     6
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
     7
  > # Test deprecated config
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     8
  > threshold=1000B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     9
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    11
  $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    12
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    13
# Prepare server and enable extension
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    14
  $ hg init server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    15
  $ hg clone -q server client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    16
  $ cd client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    17
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    18
# Commit small file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    19
  $ echo s > smallfile
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
    20
  $ echo '**.py = LF' > .hgeol
35800
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    21
  $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file"
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    22
  hg: parse error: unsupported file pattern: size(">1000B")
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    23
  (paths must be prefixed with "path:")
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    24
  [255]
35799
b91bca85ba73 lfs: don't automatically exclude '.hg*' files from external tracking
Matt Harbison <matt_harbison@yahoo.com>
parents: 35798
diff changeset
    25
  $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file"
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    26
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    27
# Commit large file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    28
  $ echo $LONG > largefile
35186
e0a1b9ee93cd lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com>
parents: 35161
diff changeset
    29
  $ grep lfs .hg/requires
e0a1b9ee93cd lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com>
parents: 35161
diff changeset
    30
  [1]
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    31
  $ hg commit --traceback -Aqm "add large file"
35186
e0a1b9ee93cd lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com>
parents: 35161
diff changeset
    32
  $ grep lfs .hg/requires
e0a1b9ee93cd lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com>
parents: 35161
diff changeset
    33
  lfs
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    34
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    35
# Ensure metadata is stored
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    36
  $ hg debugdata largefile 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    37
  version https://git-lfs.github.com/spec/v1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    38
  oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    39
  size 1501
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    40
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    41
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    42
# Check the blobstore is populated
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    43
  $ find .hg/store/lfs/objects | sort
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    44
  .hg/store/lfs/objects
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    45
  .hg/store/lfs/objects/f1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    46
  .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    47
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    48
# Check the blob stored contains the actual contents of the file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    49
  $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    50
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    51
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    52
# Push changes to the server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    53
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    54
  $ hg push
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35385
diff changeset
    55
  pushing to $TESTTMP/server
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    56
  searching for changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    57
  abort: lfs.url needs to be configured
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    58
  [255]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    59
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    60
  $ cat >> $HGRCPATH << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    61
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    62
  > url=file:$TESTTMP/dummy-remote/
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    63
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    64
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
    65
Push to a local non-lfs repo with the extension enabled will add the
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
    66
lfs requirement
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
    67
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
    68
  $ grep lfs $TESTTMP/server/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
    69
  [1]
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    70
  $ hg push -v | egrep -v '^(uncompressed| )'
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35385
diff changeset
    71
  pushing to $TESTTMP/server
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    72
  searching for changes
35477
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35456
diff changeset
    73
  lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    74
  2 changesets found
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    75
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    76
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    77
  adding file changes
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
    78
  added 2 changesets with 3 changes to 3 files
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
    79
  calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
    80
  $ grep lfs $TESTTMP/server/.hg/requires
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
    81
  lfs
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    82
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    83
# Unknown URL scheme
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    84
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    85
  $ hg push --config lfs.url=ftp://foobar
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    86
  abort: lfs: unknown url scheme: ftp
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    87
  [255]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    88
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    89
  $ cd ../
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    90
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    91
# Initialize new client (not cloning) and setup extension
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    92
  $ hg init client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    93
  $ cd client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    94
  $ cat >> .hg/hgrc <<EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    95
  > [paths]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    96
  > default = $TESTTMP/server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    97
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    98
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    99
# Pull from server
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
   100
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
   101
Pulling a local lfs repo into a local non-lfs repo with the extension
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
   102
enabled adds the lfs requirement
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
   103
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
   104
  $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
   105
  $TESTTMP/server/.hg/requires:lfs
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   106
  $ hg pull default
35400
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35385
diff changeset
   107
  pulling from $TESTTMP/server
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   108
  requesting all changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   109
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   110
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   111
  adding file changes
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   112
  added 2 changesets with 3 changes to 3 files
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   113
  new changesets 0ead593177f7:b88141481348
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   114
  (run 'hg update' to get a working copy)
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
   115
  $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
   116
  .hg/requires:lfs
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
   117
  $TESTTMP/server/.hg/requires:lfs
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   118
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   119
# Check the blobstore is not yet populated
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   120
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   121
  [1]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   122
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   123
# Update to the last revision containing the large file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   124
  $ hg update
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   125
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   126
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   127
# Check the blobstore has been populated on update
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   128
  $ find .hg/store/lfs/objects | sort
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   129
  .hg/store/lfs/objects
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   130
  .hg/store/lfs/objects/f1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   131
  .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   132
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   133
# Check the contents of the file are fetched from blobstore when requested
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   134
  $ hg cat -r . largefile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   135
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   136
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   137
# Check the file has been copied in the working copy
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   138
  $ cat largefile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   139
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   140
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   141
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   142
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   143
# Check rename, and switch between large and small files
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   144
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   145
  $ hg init repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   146
  $ cd repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   147
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   148
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   149
  > track=size(">10B")
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   150
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   151
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   152
  $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   153
  $ echo SHORTER > small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   154
  $ hg add . -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   155
  $ hg commit -m 'commit with lfs content'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   156
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   157
  $ hg mv large l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   158
  $ hg mv small s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   159
  $ hg commit -m 'renames'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   160
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   161
  $ echo SHORT > l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   162
  $ echo BECOME-LARGER-FROM-SHORTER > s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   163
  $ hg commit -m 'large to small, small to large'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   164
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   165
  $ echo 1 >> l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   166
  $ echo 2 >> s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   167
  $ hg commit -m 'random modifications'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   168
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   169
  $ echo RESTORE-TO-BE-LARGE > l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   170
  $ echo SHORTER > s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   171
  $ hg commit -m 'switch large and small again'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   172
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   173
# Test lfs_files template
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   174
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   175
  $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   176
  0 large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   177
  1 l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   178
  2 s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   179
  3 s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   180
  4 l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   181
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   182
# Push and pull the above repo
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   183
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   184
  $ hg --cwd .. init repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   185
  $ hg push ../repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   186
  pushing to ../repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   187
  searching for changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   188
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   189
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   190
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   191
  added 5 changesets with 10 changes to 4 files
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   192
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   193
  $ hg --cwd .. init repo5
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   194
  $ hg --cwd ../repo5 pull ../repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   195
  pulling from ../repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   196
  requesting all changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   197
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   198
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   199
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   200
  added 5 changesets with 10 changes to 4 files
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   201
  new changesets fd47a419c4f7:5adf850972b9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   202
  (run 'hg update' to get a working copy)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   203
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   204
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   205
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   206
# Test clone
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   207
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   208
  $ hg init repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   209
  $ cd repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   210
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   211
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   212
  > track=size(">30B")
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   213
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   214
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   215
  $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   216
  $ echo SMALL > small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   217
  $ hg commit -Aqm 'create a lfs file' large small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   218
  $ hg debuglfsupload -r 'all()' -v
35477
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35456
diff changeset
   219
  lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   220
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   221
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   222
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   223
  $ hg clone repo6 repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   224
  updating to branch default
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   225
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   226
  $ cd repo7
35223
24aa4853c031 lfs: enable the extension locally after cloning a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35189
diff changeset
   227
  $ hg config extensions --debug | grep lfs
24aa4853c031 lfs: enable the extension locally after cloning a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35189
diff changeset
   228
  $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   229
  $ cat large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   230
  LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   231
  $ cat small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   232
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   233
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   234
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   235
35224
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35223
diff changeset
   236
  $ hg --config extensions.share= share repo7 sharedrepo
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35223
diff changeset
   237
  updating working directory
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35223
diff changeset
   238
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35223
diff changeset
   239
  $ hg -R sharedrepo config extensions --debug | grep lfs
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35223
diff changeset
   240
  $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob)
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35223
diff changeset
   241
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   242
# Test rename and status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   243
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   244
  $ hg init repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   245
  $ cd repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   246
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   247
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   248
  > track=size(">10B")
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   249
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   250
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   251
  $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   252
  $ echo SMALL > a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   253
  $ hg commit -m a -A a1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   254
  $ hg status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   255
  $ hg mv a1 b1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   256
  $ hg mv a2 a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   257
  $ hg mv b1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   258
  $ hg commit -m b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   259
  $ hg status
35385
c7d49b87c1ee tests: use Python to write binary data in lfs test instead of shell
Augie Fackler <raf@durin42.com>
parents: 35343
diff changeset
   260
  >>> with open('a2', 'wb') as f:
c7d49b87c1ee tests: use Python to write binary data in lfs test instead of shell
Augie Fackler <raf@durin42.com>
parents: 35343
diff changeset
   261
  ...     f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA')
c7d49b87c1ee tests: use Python to write binary data in lfs test instead of shell
Augie Fackler <raf@durin42.com>
parents: 35343
diff changeset
   262
  >>> with open('a1', 'wb') as f:
c7d49b87c1ee tests: use Python to write binary data in lfs test instead of shell
Augie Fackler <raf@durin42.com>
parents: 35343
diff changeset
   263
  ...     f.write(b'\1\nMETA\n')
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   264
  $ hg commit -m meta
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   265
  $ hg status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   266
  $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   267
  2:  |  | 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   268
  1: a1 (a2)a2 (a1) |  | 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   269
  0:  |  | a1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   270
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   271
  $ for n in a1 a2; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   272
  >   for r in 0 1 2; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   273
  >     printf '\n%s @ %s\n' $n $r
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   274
  >     hg debugdata $n $r
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   275
  >   done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   276
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   277
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   278
  a1 @ 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   279
  version https://git-lfs.github.com/spec/v1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   280
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   281
  size 29
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   282
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   283
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   284
  a1 @ 1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   285
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   286
  copy: a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   287
  copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   288
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   289
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   290
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   291
  a1 @ 2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   292
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   293
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   294
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   295
  META
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   296
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   297
  a2 @ 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   298
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   299
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   300
  a2 @ 1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   301
  version https://git-lfs.github.com/spec/v1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   302
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   303
  size 29
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   304
  x-hg-copy a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   305
  x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   306
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   307
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   308
  a2 @ 2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   309
  version https://git-lfs.github.com/spec/v1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   310
  oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   311
  size 32
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   312
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   313
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   314
# Verify commit hashes include rename metadata
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   315
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   316
  $ hg log -T '{rev}:{node|short} {desc}\n'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   317
  2:0fae949de7fa meta
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   318
  1:9cd6bdffdac0 b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   319
  0:7f96794915f7 a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   320
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   321
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   322
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   323
# Test bundle
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   324
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   325
  $ hg init repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   326
  $ cd repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   327
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   328
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   329
  > track=size(">10B")
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   330
  > [diff]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   331
  > git=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   332
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   333
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   334
  $ for i in 0 single two three 4; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   335
  >   echo 'THIS-IS-LFS-'$i > a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   336
  >   hg commit -m a-$i -A a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   337
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   338
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   339
  $ hg update 2 -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   340
  $ echo 'THIS-IS-LFS-2-CHILD' > a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   341
  $ hg commit -m branching -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   342
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   343
  $ hg bundle --base 1 bundle.hg -v
35477
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35456
diff changeset
   344
  lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35456
diff changeset
   345
  lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35456
diff changeset
   346
  lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35456
diff changeset
   347
  lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   348
  4 changesets found
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   349
  uncompressed size of bundle content:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   350
       * (changelog) (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   351
       * (manifests) (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   352
       *  a (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   353
  $ hg --config extensions.strip= strip -r 2 --no-backup --force -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   354
  $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   355
  5 branching
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   356
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   357
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   358
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   359
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   360
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   361
  +THIS-IS-LFS-2-CHILD
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   362
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   363
  4 a-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   364
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   365
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   366
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   367
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   368
  -THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   369
  +THIS-IS-LFS-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   370
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   371
  3 a-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   372
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   373
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   374
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   375
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   376
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   377
  +THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   378
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   379
  2 a-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   380
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   381
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   382
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   383
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   384
  -THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   385
  +THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   386
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   387
  1 a-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   388
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   389
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   390
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   391
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   392
  -THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   393
  +THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   394
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   395
  0 a-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   396
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   397
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   398
  --- /dev/null
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   399
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   400
  @@ -0,0 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   401
  +THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   402
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   403
  $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   404
  $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   405
  5 branching
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   406
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   407
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   408
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   409
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   410
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   411
  +THIS-IS-LFS-2-CHILD
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   412
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   413
  4 a-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   414
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   415
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   416
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   417
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   418
  -THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   419
  +THIS-IS-LFS-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   420
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   421
  3 a-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   422
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   423
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   424
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   425
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   426
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   427
  +THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   428
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   429
  2 a-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   430
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   431
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   432
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   433
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   434
  -THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   435
  +THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   436
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   437
  1 a-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   438
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   439
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   440
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   441
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   442
  -THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   443
  +THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   444
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   445
  0 a-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   446
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   447
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   448
  --- /dev/null
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   449
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   450
  @@ -0,0 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   451
  +THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   452
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   453
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   454
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   455
# Test isbinary
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   456
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   457
  $ hg init repo10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   458
  $ cd repo10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   459
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   460
  > [extensions]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   461
  > lfs=
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   462
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   463
  > track=all()
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   464
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   465
  $ $PYTHON <<'EOF'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   466
  > def write(path, content):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   467
  >     with open(path, 'wb') as f:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   468
  >         f.write(content)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   469
  > write('a', b'\0\0')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   470
  > write('b', b'\1\n')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   471
  > write('c', b'\1\n\0')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   472
  > write('d', b'xx')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   473
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   474
  $ hg add a b c d
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   475
  $ hg diff --stat
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   476
   a |  Bin 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   477
   b |    1 +
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   478
   c |  Bin 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   479
   d |    1 +
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   480
   4 files changed, 2 insertions(+), 0 deletions(-)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   481
  $ hg commit -m binarytest
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   482
  $ cat > $TESTTMP/dumpbinary.py << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   483
  > def reposetup(ui, repo):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   484
  >     for n in 'abcd':
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   485
  >         ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary()))
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   486
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   487
  $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   488
  a: binary=True
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   489
  b: binary=False
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   490
  c: binary=True
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   491
  d: binary=False
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   492
  b55353847f02 tip
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   493
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   494
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   495
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   496
# Test fctx.cmp fastpath - diff without LFS blobs
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   497
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   498
  $ hg init repo12
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   499
  $ cd repo12
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   500
  $ cat >> .hg/hgrc <<EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   501
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   502
  > threshold=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   503
  > EOF
35161
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   504
  $ cat > ../patch.diff <<EOF
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   505
  > # HG changeset patch
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   506
  > 2
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   507
  > 
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   508
  > diff --git a/a b/a
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   509
  > old mode 100644
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   510
  > new mode 100755
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   511
  > EOF
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   512
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   513
  $ for i in 1 2 3; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   514
  >     cp ../repo10/a a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   515
  >     if [ $i = 3 ]; then
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   516
  >         # make a content-only change
35161
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   517
  >         hg import -q --bypass ../patch.diff
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   518
  >         hg update -q
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   519
  >         rm ../patch.diff
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   520
  >     else
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   521
  >         echo $i >> a
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35124
diff changeset
   522
  >         hg commit -m $i -A a
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   523
  >     fi
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   524
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   525
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   526
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   527
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   528
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   529
  $ hg clone repo12 repo13 --noupdate
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   530
  $ cd repo13
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   531
  $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   532
  2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   533
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   534
  old mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   535
  new mode 100755
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   536
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   537
  2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   538
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   539
  Binary file a has changed
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   540
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   541
  1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   542
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   543
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   544
  Binary file a has changed
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   545
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   546
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   547
  [1]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   548
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   549
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   550
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   551
# Test filter
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   552
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   553
  $ hg init repo11
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   554
  $ cd repo11
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   555
  $ cat >> .hg/hgrc << EOF
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   556
  > [lfs]
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   557
  > track=(**.a & size(">5B")) | (**.b & !size(">5B"))
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   558
  >      | (**.c & "path:d" & !"path:d/c.c") | size(">10B")
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   559
  > EOF
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   560
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   561
  $ mkdir a
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   562
  $ echo aaaaaa > a/1.a
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   563
  $ echo a > a/2.a
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   564
  $ echo aaaaaa > 1.b
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   565
  $ echo a > 2.b
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   566
  $ echo a > 1.c
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   567
  $ mkdir d
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   568
  $ echo a > d/c.c
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   569
  $ echo a > d/d.c
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   570
  $ echo aaaaaaaaaaaa > x
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   571
  $ hg add . -q
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   572
  $ hg commit -m files
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   573
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   574
  $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   575
  >   if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   576
  >     echo "${p}: is lfs"
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   577
  >   else
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   578
  >     echo "${p}: not lfs"
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   579
  >   fi
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   580
  > done
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   581
  a/1.a: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   582
  a/2.a: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   583
  1.b: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   584
  2.b: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   585
  1.c: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   586
  d/c.c: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   587
  d/d.c: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   588
  x: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   589
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   590
  $ cd ..
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   591
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   592
# Verify the repos
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   593
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   594
  $ cat > $TESTTMP/dumpflog.py << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   595
  > # print raw revision sizes, flags, and hashes for certain files
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   596
  > import hashlib
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   597
  > from mercurial import revlog
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   598
  > from mercurial.node import short
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   599
  > def hash(rawtext):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   600
  >     h = hashlib.sha512()
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   601
  >     h.update(rawtext)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   602
  >     return h.hexdigest()[:4]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   603
  > def reposetup(ui, repo):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   604
  >     # these 2 files are interesting
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   605
  >     for name in ['l', 's']:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   606
  >         fl = repo.file(name)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   607
  >         if len(fl) == 0:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   608
  >             continue
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   609
  >         sizes = [revlog.revlog.rawsize(fl, i) for i in fl]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   610
  >         texts = [fl.revision(i, raw=True) for i in fl]
35124
eb4241f914a3 test-lfs: cast the flags printed to an int
Matt Harbison <matt_harbison@yahoo.com>
parents: 35121
diff changeset
   611
  >         flags = [int(fl.flags(i)) for i in fl]
35121
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   612
  >         hashes = [hash(t) for t in texts]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   613
  >         print('  %s: rawsizes=%r flags=%r hashes=%r'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   614
  >               % (name, sizes, flags, hashes))
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   615
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   616
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   617
  $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   618
  >          repo10; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   619
  >   echo 'repo:' $i
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   620
  >   hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   621
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   622
  repo: client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   623
  repo: client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   624
  repo: server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   625
  repo: repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   626
    l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   627
    s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   628
  repo: repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   629
    l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   630
    s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   631
  repo: repo5
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   632
    l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d']
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   633
    s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b']
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   634
  repo: repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   635
  repo: repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   636
  repo: repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   637
  repo: repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   638
  repo: repo10
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   639
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   640
repo13 doesn't have any cached lfs files and its source never pushed its
35289
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   641
files.  Therefore, the files don't exist in the remote store.  Use the files in
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   642
the user cache.
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   643
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   644
  $ test -d $TESTTMP/repo13/.hg/store/lfs/objects
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   645
  [1]
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   646
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   647
  $ hg --config extensions.share= share repo13 repo14
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   648
  updating working directory
35289
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   649
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   650
  $ hg -R repo14 -q verify
35289
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   651
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   652
  $ hg clone repo13 repo15
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   653
  updating to branch default
35289
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   654
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   655
  $ hg -R repo15 -q verify
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   656
35289
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   657
If the source repo doesn't have the blob (maybe it was pulled or cloned with
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   658
--noupdate), the blob is still accessible via the global cache to send to the
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   659
remote store.
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   660
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   661
  $ rm -rf $TESTTMP/repo15/.hg/store/lfs
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   662
  $ hg init repo16
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   663
  $ hg -R repo15 push repo16
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   664
  pushing to repo16
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   665
  searching for changes
35289
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   666
  adding changesets
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   667
  adding manifests
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   668
  adding file changes
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35287
diff changeset
   669
  added 3 changesets with 2 changes to 1 files
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   670
  $ hg -R repo15 -q verify
35287
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35225
diff changeset
   671
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   672
Test damaged file scenarios.  (This also damages the usercache because of the
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   673
hardlinks.)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   674
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   675
  $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   676
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   677
Repo with damaged lfs objects in any revision will fail verification.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   678
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   679
  $ hg -R repo5 verify
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   680
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   681
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   682
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   683
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   684
   l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   685
   large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   686
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   687
  2 integrity errors encountered!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   688
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   689
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   690
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   691
Updates work after cloning a damaged repo, if the damaged lfs objects aren't in
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   692
the update destination.  Those objects won't be added to the new repo's store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   693
because they aren't accessed.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   694
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   695
  $ hg clone -v repo5 fromcorrupt
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   696
  updating to branch default
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   697
  resolving manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   698
  getting l
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   699
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   700
  getting s
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   701
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   702
  $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   703
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   704
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   705
Verify will copy/link all lfs objects into the local store that aren't already
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   706
present.  Bypass the corrupted usercache to show that verify works when fed by
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   707
the (uncorrupted) remote store.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   708
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   709
  $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   710
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   711
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   712
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   713
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   714
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   715
  lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   716
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   717
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   718
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   719
  lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   720
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   721
  lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   722
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   723
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   724
35481
bb6a80fc969a lfs: only hardlink between the usercache and local store if the blob verifies
Matt Harbison <matt_harbison@yahoo.com>
parents: 35480
diff changeset
   725
Verify will not copy/link a corrupted file from the usercache into the local
bb6a80fc969a lfs: only hardlink between the usercache and local store if the blob verifies
Matt Harbison <matt_harbison@yahoo.com>
parents: 35480
diff changeset
   726
store, and poison it.  (The verify with a good remote now works.)
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   727
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   728
  $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   729
  $ hg -R fromcorrupt verify -v
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   730
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   731
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   732
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   733
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   734
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   735
   l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   736
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   737
   large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   738
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   739
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   740
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   741
  2 integrity errors encountered!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   742
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   743
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   744
  $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   745
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   746
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   747
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   748
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   749
  checking files
35481
bb6a80fc969a lfs: only hardlink between the usercache and local store if the blob verifies
Matt Harbison <matt_harbison@yahoo.com>
parents: 35480
diff changeset
   750
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   751
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   752
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   753
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   754
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   755
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   756
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   757
Damaging a file required by the update destination fails the update.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   758
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   759
  $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   760
  $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   761
  updating to branch default
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   762
  resolving manifests
35552
fd610befc37f lfs: use the localstore download method to transfer from remote stores
Matt Harbison <matt_harbison@yahoo.com>
parents: 35508
diff changeset
   763
  abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   764
  [255]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   765
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   766
A corrupted lfs blob is not transferred from a file://remotestore to the
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   767
usercache or local store.
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   768
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   769
  $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   770
  [1]
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   771
  $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   772
  [1]
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   773
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   774
  $ hg -R fromcorrupt2 verify
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   775
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   776
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   777
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   778
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   779
   l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   780
   large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   781
  4 files, 5 changesets, 10 total revisions
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   782
  2 integrity errors encountered!
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   783
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   784
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   785
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   786
Corrupt local files are not sent upstream.  (The alternate dummy remote
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   787
avoids the corrupt lfs object in the original remote.)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   788
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   789
  $ mkdir $TESTTMP/dummy-remote2
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   790
  $ hg init dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   791
  $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   792
  pushing to dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   793
  searching for changes
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   794
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   795
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   796
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   797
  abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   798
  (run hg verify)
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   799
  [255]
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   800
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   801
  $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   802
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   803
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   804
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   805
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   806
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   807
   l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   808
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   809
   large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   810
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   811
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   812
  4 files, 5 changesets, 10 total revisions
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   813
  2 integrity errors encountered!
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   814
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   815
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   816
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   817
  $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   818
  sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   819
  $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
35480
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   820
  sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   821
  $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35478
diff changeset
   822
  [1]
35478
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   823
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   824
Accessing a corrupt file will complain
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   825
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   826
  $ hg --cwd fromcorrupt2 cat -r 0 large
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   827
  abort: integrity check failed on data/large.i:0!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   828
  [255]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   829
35649
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
   830
lfs -> normal -> lfs round trip conversions are possible.  The 'none()'
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
   831
predicate on the command line will override whatever is configured globally and
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
   832
locally, and ensures everything converts to a regular file.  For lfs -> normal,
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   833
there's no 'lfs' destination repo requirement.  For normal -> lfs, there is.
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   834
35649
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
   835
  $ hg --config extensions.convert= --config 'lfs.track=none()' \
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   836
  >    convert repo8 convert_normal
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   837
  initializing destination convert_normal repository
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   838
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   839
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   840
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   841
  2 a
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   842
  1 b
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   843
  0 meta
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   844
  $ grep 'lfs' convert_normal/.hg/requires
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   845
  [1]
35663
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   846
  $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   847
  THIS-IS-LFS-BECAUSE-10-BYTES
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   848
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   849
  $ hg --config extensions.convert= --config lfs.threshold=10B \
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   850
  >    convert convert_normal convert_lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   851
  initializing destination convert_lfs repository
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   852
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   853
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   854
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   855
  2 a
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   856
  1 b
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   857
  0 meta
35663
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   858
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   859
  $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   860
  version https://git-lfs.github.com/spec/v1
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   861
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   862
  size 29
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
   863
  x-is-binary 0
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   864
  $ hg --cwd convert_lfs debugdata a1 0
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   865
  version https://git-lfs.github.com/spec/v1
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   866
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   867
  size 29
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   868
  x-is-binary 0
35797
76cb752af07a lfs: rename {pointer} to {lfspointer}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35769
diff changeset
   869
  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}"
35731
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   870
  version=https://git-lfs.github.com/spec/v1
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   871
  oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   872
  size=29
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   873
  x-is-binary=0
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   874
  $ hg --cwd convert_lfs log -r 0 \
35797
76cb752af07a lfs: rename {pointer} to {lfspointer}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35769
diff changeset
   875
  >    -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}'
35731
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   876
  sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   877
  sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
35797
76cb752af07a lfs: rename {pointer} to {lfspointer}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35769
diff changeset
   878
  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}'
35731
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
   879
  version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
35658
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
   880
  $ hg --cwd convert_lfs \
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
   881
  >     log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
35658
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
   882
  0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
   883
  1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
   884
  2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
35657
8580e5898cb7 lfs: convert '{lfs_files}' keyword to a hybrid list
Matt Harbison <matt_harbison@yahoo.com>
parents: 35650
diff changeset
   885
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   886
  $ grep 'lfs' convert_lfs/.hg/requires
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   887
  lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   888
35650
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   889
The hashes in all stages of the conversion are unchanged.
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   890
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   891
  $ hg -R repo8 log -T '{node|short}\n'
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   892
  0fae949de7fa
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   893
  9cd6bdffdac0
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   894
  7f96794915f7
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   895
  $ hg -R convert_normal log -T '{node|short}\n'
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   896
  0fae949de7fa
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   897
  9cd6bdffdac0
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   898
  7f96794915f7
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   899
  $ hg -R convert_lfs log -T '{node|short}\n'
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   900
  0fae949de7fa
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   901
  9cd6bdffdac0
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   902
  7f96794915f7
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
   903
35189
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   904
This convert is trickier, because it contains deleted files (via `hg mv`)
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   905
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   906
  $ hg --config extensions.convert= --config lfs.threshold=1000M \
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   907
  >    convert repo3 convert_normal2
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   908
  initializing destination convert_normal2 repository
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   909
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   910
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   911
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   912
  4 commit with lfs content
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   913
  3 renames
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   914
  2 large to small, small to large
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   915
  1 random modifications
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   916
  0 switch large and small again
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   917
  $ grep 'lfs' convert_normal2/.hg/requires
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   918
  [1]
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   919
  $ hg --cwd convert_normal2 debugdata large 0
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   920
  LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   921
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   922
  $ hg --config extensions.convert= --config lfs.threshold=10B \
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   923
  >    convert convert_normal2 convert_lfs2
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   924
  initializing destination convert_lfs2 repository
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   925
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   926
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   927
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   928
  4 commit with lfs content
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   929
  3 renames
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   930
  2 large to small, small to large
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   931
  1 random modifications
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   932
  0 switch large and small again
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   933
  $ grep 'lfs' convert_lfs2/.hg/requires
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   934
  lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   935
  $ hg --cwd convert_lfs2 debugdata large 0
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   936
  version https://git-lfs.github.com/spec/v1
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   937
  oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   938
  size 39
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35186
diff changeset
   939
  x-is-binary 0
35225
8887a45e3384 lfs: enable the extension locally after converting to an 'lfs' repo
Matt Harbison <matt_harbison@yahoo.com>
parents: 35224
diff changeset
   940
8887a45e3384 lfs: enable the extension locally after converting to an 'lfs' repo
Matt Harbison <matt_harbison@yahoo.com>
parents: 35224
diff changeset
   941
  $ hg -R convert_lfs2 config --debug extensions | grep lfs
8887a45e3384 lfs: enable the extension locally after converting to an 'lfs' repo
Matt Harbison <matt_harbison@yahoo.com>
parents: 35224
diff changeset
   942
  $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
35456
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   943
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   944
Committing deleted files works:
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   945
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   946
  $ hg init $TESTTMP/repo-del
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   947
  $ cd $TESTTMP/repo-del
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   948
  $ echo 1 > A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   949
  $ hg commit -m 'add A' -A A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   950
  $ hg rm A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35451
diff changeset
   951
  $ hg commit -m 'rm A'
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   952
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   953
Bad .hglfs files will block the commit with a useful message
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   954
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   955
  $ cat > .hglfs << EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   956
  > [track]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   957
  > **.test = size(">5B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   958
  > bad file ... no commit
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   959
  > EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   960
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   961
  $ echo x > file.txt
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   962
  $ hg ci -Aqm 'should fail'
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   963
  hg: parse error at .hglfs:3: bad file ... no commit
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   964
  [255]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   965
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   966
  $ cat > .hglfs << EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   967
  > [track]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   968
  > **.test = size(">5B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   969
  > ** = nonexistent()
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   970
  > EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   971
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   972
  $ hg ci -Aqm 'should fail'
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   973
  abort: parse error in .hglfs: unknown identifier: nonexistent
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   974
  [255]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   975
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   976
'**' works out to mean all files.
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   977
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   978
  $ cat > .hglfs << EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   979
  > [track]
35799
b91bca85ba73 lfs: don't automatically exclude '.hg*' files from external tracking
Matt Harbison <matt_harbison@yahoo.com>
parents: 35798
diff changeset
   980
  > path:.hglfs = none()
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   981
  > **.test = size(">5B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   982
  > **.exclude = none()
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   983
  > ** = size(">10B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   984
  > EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   985
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
   986
The LFS policy takes effect without tracking the .hglfs file
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   987
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   988
  $ echo 'largefile' > lfs.test
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   989
  $ echo '012345678901234567890' > nolfs.exclude
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   990
  $ echo '01234567890123456' > lfs.catchall
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
   991
  $ hg add *
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
   992
  $ hg ci -qm 'before add .hglfs'
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
   993
  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   994
  2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   995
  lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   996
  
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
   997
The .hglfs file works when tracked
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   998
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
   999
  $ echo 'largefile2' > lfs.test
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1000
  $ echo '012345678901234567890a' > nolfs.exclude
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1001
  $ echo '01234567890123456a' > lfs.catchall
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1002
  $ hg ci -Aqm 'after adding .hglfs'
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
  1003
  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1004
  3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1005
  lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1006
  
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1007
The LFS policy stops when the .hglfs is gone
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1008
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1009
  $ hg rm .hglfs
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1010
  $ echo 'largefile3' > lfs.test
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1011
  $ echo '012345678901234567890abc' > nolfs.exclude
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1012
  $ echo '01234567890123456abc' > lfs.catchall
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1013
  $ hg ci -qm 'file test' -X .hglfs
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
  1014
  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1015
  4: 
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1016
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1017
  $ cd ..
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1018
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
  1019
Unbundling adds a requirement to a non-lfs repo, if necessary.
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1020
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1021
  $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1022
  $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1023
  $ hg init unbundle
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1024
  $ hg pull -R unbundle -q nolfs.hg
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1025
  $ grep lfs unbundle/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1026
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1027
  $ hg pull -R unbundle -q lfs.hg
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1028
  $ grep lfs unbundle/.hg/requires
35508
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35506
diff changeset
  1029
  lfs
35506
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1030
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1031
  $ hg init no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1032
  $ cat >> no_lfs/.hg/hgrc <<EOF
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1033
  > [experimental]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1034
  > changegroup3 = True
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1035
  > [extensions]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1036
  > lfs=!
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1037
  > EOF
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1038
  $ cp -R no_lfs no_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1039
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1040
Pushing from a local lfs repo to a local repo without an lfs requirement and
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1041
with lfs disabled, fails.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1042
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1043
  $ hg push -R convert_lfs2 no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1044
  pushing to no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1045
  abort: required features are not supported in the destination: lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1046
  [255]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1047
  $ grep lfs no_lfs/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1048
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1049
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1050
Pulling from a local lfs repo to a local repo without an lfs requirement and
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1051
with lfs disabled, fails.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1052
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1053
  $ hg pull -R no_lfs2 convert_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1054
  pulling from convert_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1055
  abort: required features are not supported in the destination: lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1056
  [255]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1057
  $ grep lfs no_lfs2/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35481
diff changeset
  1058
  [1]