tests/test-lfs.t
author Matt Harbison <matt_harbison@yahoo.com>
Fri, 22 Dec 2017 14:53:54 -0500
changeset 35502 67611e06ff08
parent 35477 bb6a80fc969a
child 35504 6bb940de4c4c
permissions -rw-r--r--
test-lfs: add tests covering local exchanges The root issue here is that requirements are not exchanged and preserved on push/pull. This can be handled with a changegroup hook. Testing for remote exchanges is much more extensive (it's possible for one process or the other to not have the extension loaded at all), so it is added separately.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35098
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]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     7
  > threshold=1000B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     8
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
     9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    10
  $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    11
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    12
# Prepare server and enable extension
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    13
  $ hg init server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    14
  $ hg clone -q server client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    15
  $ cd client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    16
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    17
# Commit small file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    18
  $ echo s > smallfile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    19
  $ hg commit -Aqm "add small file"
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    20
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    21
# Commit large file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    22
  $ echo $LONG > largefile
35175
e0a1b9ee93cd lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com>
parents: 35140
diff changeset
    23
  $ 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: 35140
diff changeset
    24
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    25
  $ hg commit --traceback -Aqm "add large file"
35175
e0a1b9ee93cd lfs: add a repo requirement for this extension once an lfs file is committed
Matt Harbison <matt_harbison@yahoo.com>
parents: 35140
diff changeset
    26
  $ 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: 35140
diff changeset
    27
  lfs
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    28
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    29
# Ensure metadata is stored
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    30
  $ hg debugdata largefile 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    31
  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
    32
  oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    33
  size 1501
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    34
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    35
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    36
# Check the blobstore is populated
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    37
  $ find .hg/store/lfs/objects | sort
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    38
  .hg/store/lfs/objects
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    39
  .hg/store/lfs/objects/f1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    40
  .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
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 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
    43
  $ 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
    44
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    45
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    46
# Push changes to the server
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
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35376
diff changeset
    49
  pushing to $TESTTMP/server
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    50
  searching for changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    51
  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
    52
  [255]
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
  $ cat >> $HGRCPATH << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    55
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    56
  > url=file:$TESTTMP/dummy-remote/
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    57
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    58
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    59
TODO: Push to a local non-lfs repo with the extension enabled should add the
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    60
lfs requirement
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    61
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    62
  $ grep lfs $TESTTMP/server/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    63
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    64
  $ hg push -v | egrep -v '^(uncompressed| )'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35376
diff changeset
    65
  pushing to $TESTTMP/server
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    66
  searching for changes
35473
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35452
diff changeset
    67
  lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    68
  2 changesets found
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    69
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    70
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    71
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    72
  added 2 changesets with 2 changes to 2 files
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    73
  $ grep lfs $TESTTMP/server/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    74
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    75
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    76
# Unknown URL scheme
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    77
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    78
  $ 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
    79
  abort: lfs: unknown url scheme: ftp
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    80
  [255]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    81
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    82
  $ cd ../
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    83
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    84
# 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
    85
  $ hg init client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    86
  $ cd client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    87
  $ cat >> .hg/hgrc <<EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    88
  > [paths]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    89
  > default = $TESTTMP/server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    90
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    91
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    92
# Pull from server
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    93
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    94
TODO: Pulling a local lfs repo into a local non-lfs repo with the extension
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    95
enabled should add the lfs requirement
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    96
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    97
  $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
    98
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    99
  $ hg pull default
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35376
diff changeset
   100
  pulling from $TESTTMP/server
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   101
  requesting all changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   102
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   103
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   104
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   105
  added 2 changesets with 2 changes to 2 files
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   106
  new changesets b29ba743f89d:00c137947d30
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   107
  (run 'hg update' to get a working copy)
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   108
  $ grep lfs .hg/requires $TESTTMP/server/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   109
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   110
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   111
# 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
   112
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   113
  [1]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   114
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   115
# 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
   116
  $ hg update
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   117
  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
   118
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   119
# 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
   120
  $ find .hg/store/lfs/objects | sort
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   121
  .hg/store/lfs/objects
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   122
  .hg/store/lfs/objects/f1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   123
  .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   124
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   125
# 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
   126
  $ hg cat -r . largefile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   127
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   128
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   129
# 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
   130
  $ cat largefile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   131
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
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
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   134
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   135
# 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
   136
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   137
  $ hg init repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   138
  $ cd repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   139
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   140
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   141
  > threshold=10B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   142
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   143
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   144
  $ 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
   145
  $ echo SHORTER > small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   146
  $ hg add . -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   147
  $ 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
   148
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   149
  $ hg mv large l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   150
  $ hg mv small s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   151
  $ hg commit -m 'renames'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   152
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   153
  $ echo SHORT > l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   154
  $ echo BECOME-LARGER-FROM-SHORTER > s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   155
  $ 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
   156
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   157
  $ echo 1 >> l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   158
  $ echo 2 >> s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   159
  $ hg commit -m 'random modifications'
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 RESTORE-TO-BE-LARGE > l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   162
  $ echo SHORTER > s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   163
  $ 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
   164
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   165
# Test lfs_files template
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   166
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   167
  $ 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
   168
  0 large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   169
  1 l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   170
  2 s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   171
  3 s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   172
  4 l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   173
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   174
# Push and pull the above repo
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   175
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   176
  $ hg --cwd .. init repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   177
  $ hg push ../repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   178
  pushing to ../repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   179
  searching for changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   180
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   181
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   182
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   183
  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
   184
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   185
  $ hg --cwd .. init repo5
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   186
  $ hg --cwd ../repo5 pull ../repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   187
  pulling from ../repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   188
  requesting all changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   189
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   190
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   191
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   192
  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
   193
  new changesets fd47a419c4f7:5adf850972b9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   194
  (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
   195
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   196
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   197
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   198
# Test clone
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   199
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   200
  $ hg init repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   201
  $ cd repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   202
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   203
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   204
  > threshold=30B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   205
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   206
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   207
  $ 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
   208
  $ echo SMALL > small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   209
  $ 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
   210
  $ hg debuglfsupload -r 'all()' -v
35473
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35452
diff changeset
   211
  lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   212
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   213
  $ cd ..
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
  $ hg clone repo6 repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   216
  updating to branch default
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   217
  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
   218
  $ cd repo7
35213
24aa4853c031 lfs: enable the extension locally after cloning a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35178
diff changeset
   219
  $ 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: 35178
diff changeset
   220
  $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob)
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   221
  $ cat large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   222
  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
   223
  $ cat small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   224
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   225
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   226
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   227
35214
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35213
diff changeset
   228
  $ 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: 35213
diff changeset
   229
  updating working directory
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35213
diff changeset
   230
  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: 35213
diff changeset
   231
  $ 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: 35213
diff changeset
   232
  $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: 35213
diff changeset
   233
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   234
# Test rename and status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   235
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   236
  $ hg init repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   237
  $ cd repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   238
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   239
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   240
  > threshold=10B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   241
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   242
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   243
  $ 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
   244
  $ echo SMALL > a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   245
  $ 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
   246
  $ hg status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   247
  $ hg mv a1 b1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   248
  $ hg mv a2 a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   249
  $ hg mv b1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   250
  $ hg commit -m b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   251
  $ hg status
35376
c7d49b87c1ee tests: use Python to write binary data in lfs test instead of shell
Augie Fackler <raf@durin42.com>
parents: 35334
diff changeset
   252
  >>> 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: 35334
diff changeset
   253
  ...     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: 35334
diff changeset
   254
  >>> 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: 35334
diff changeset
   255
  ...     f.write(b'\1\nMETA\n')
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   256
  $ hg commit -m meta
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   257
  $ hg status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   258
  $ 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
   259
  2:  |  | 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   260
  1: a1 (a2)a2 (a1) |  | 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   261
  0:  |  | a1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   262
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   263
  $ for n in a1 a2; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   264
  >   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
   265
  >     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
   266
  >     hg debugdata $n $r
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   267
  >   done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   268
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   269
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   270
  a1 @ 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   271
  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
   272
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   273
  size 29
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   274
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   275
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   276
  a1 @ 1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   277
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   278
  copy: a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   279
  copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   280
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   281
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   282
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   283
  a1 @ 2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   284
  \x01 (esc)
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
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   287
  META
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   288
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   289
  a2 @ 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   290
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   291
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   292
  a2 @ 1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   293
  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
   294
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   295
  size 29
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   296
  x-hg-copy a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   297
  x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   298
  x-is-binary 0
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 @ 2
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:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   303
  size 32
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   304
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   305
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   306
# Verify commit hashes include rename metadata
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
  $ 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
   309
  2:0fae949de7fa meta
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   310
  1:9cd6bdffdac0 b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   311
  0:7f96794915f7 a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   312
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   313
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   314
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   315
# Test bundle
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   316
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   317
  $ hg init repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   318
  $ cd repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   319
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   320
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   321
  > threshold=10B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   322
  > [diff]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   323
  > git=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   324
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   325
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   326
  $ 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
   327
  >   echo 'THIS-IS-LFS-'$i > a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   328
  >   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
   329
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   330
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   331
  $ hg update 2 -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   332
  $ 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
   333
  $ hg commit -m branching -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   334
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   335
  $ hg bundle --base 1 bundle.hg -v
35473
02f54a1ec9eb lfs: add note messages indicating what store holds the lfs blob
Matt Harbison <matt_harbison@yahoo.com>
parents: 35452
diff changeset
   336
  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: 35452
diff changeset
   337
  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: 35452
diff changeset
   338
  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: 35452
diff changeset
   339
  lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   340
  4 changesets found
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   341
  uncompressed size of bundle content:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   342
       * (changelog) (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   343
       * (manifests) (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   344
       *  a (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   345
  $ 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
   346
  $ 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
   347
  5 branching
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   348
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   349
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   350
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   351
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   352
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   353
  +THIS-IS-LFS-2-CHILD
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   354
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   355
  4 a-4
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-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   361
  +THIS-IS-LFS-4
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
  3 a-three
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-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   369
  +THIS-IS-LFS-three
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
  2 a-two
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-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   377
  +THIS-IS-LFS-two
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
  1 a-single
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-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   385
  +THIS-IS-LFS-single
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
  0 a-0
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
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   390
  --- /dev/null
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   391
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   392
  @@ -0,0 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   393
  +THIS-IS-LFS-0
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
  $ 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
   396
  $ 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
   397
  5 branching
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   398
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   399
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   400
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   401
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   402
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   403
  +THIS-IS-LFS-2-CHILD
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   404
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   405
  4 a-4
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-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   411
  +THIS-IS-LFS-4
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
  3 a-three
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-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   419
  +THIS-IS-LFS-three
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
  2 a-two
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-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   427
  +THIS-IS-LFS-two
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
  1 a-single
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-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   435
  +THIS-IS-LFS-single
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
  0 a-0
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
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   440
  --- /dev/null
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   441
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   442
  @@ -0,0 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   443
  +THIS-IS-LFS-0
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
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   446
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   447
# Test isbinary
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   448
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   449
  $ hg init repo10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   450
  $ cd repo10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   451
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   452
  > [extensions]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   453
  > lfs=
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   454
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   455
  > threshold=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   456
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   457
  $ $PYTHON <<'EOF'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   458
  > def write(path, content):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   459
  >     with open(path, 'wb') as f:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   460
  >         f.write(content)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   461
  > write('a', b'\0\0')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   462
  > write('b', b'\1\n')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   463
  > write('c', b'\1\n\0')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   464
  > write('d', b'xx')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   465
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   466
  $ hg add a b c d
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   467
  $ hg diff --stat
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   468
   a |  Bin 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   469
   b |    1 +
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   470
   c |  Bin 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   471
   d |    1 +
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   472
   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
   473
  $ hg commit -m binarytest
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   474
  $ cat > $TESTTMP/dumpbinary.py << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   475
  > def reposetup(ui, repo):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   476
  >     for n in 'abcd':
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   477
  >         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
   478
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   479
  $ 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
   480
  a: binary=True
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   481
  b: binary=False
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   482
  c: binary=True
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   483
  d: binary=False
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   484
  b55353847f02 tip
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   485
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   486
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   487
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   488
# 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
   489
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   490
  $ hg init repo11
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   491
  $ cd repo11
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   492
  $ cat >> .hg/hgrc <<EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   493
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   494
  > threshold=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   495
  > EOF
35140
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   496
  $ 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: 35101
diff changeset
   497
  > # HG changeset patch
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   498
  > 2
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   499
  > 
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   500
  > 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: 35101
diff changeset
   501
  > old mode 100644
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   502
  > new mode 100755
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   503
  > EOF
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   504
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   505
  $ 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
   506
  >     cp ../repo10/a a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   507
  >     if [ $i = 3 ]; then
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   508
  >         # make a content-only change
35140
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   509
  >         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: 35101
diff changeset
   510
  >         hg update -q
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   511
  >         rm ../patch.diff
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   512
  >     else
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   513
  >         echo $i >> a
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   514
  >         hg commit -m $i -A a
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   515
  >     fi
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   516
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   517
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   518
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   519
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   520
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   521
  $ hg clone repo11 repo12 --noupdate
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   522
  $ cd repo12
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   523
  $ 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
   524
  2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   525
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   526
  old mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   527
  new mode 100755
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   528
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   529
  2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   530
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   531
  Binary file a has changed
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   532
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   533
  1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   534
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   535
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   536
  Binary file a has changed
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   537
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   538
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   539
  [1]
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
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   542
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   543
# Verify the repos
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   544
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   545
  $ cat > $TESTTMP/dumpflog.py << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   546
  > # 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
   547
  > import hashlib
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   548
  > from mercurial import revlog
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   549
  > from mercurial.node import short
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   550
  > def hash(rawtext):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   551
  >     h = hashlib.sha512()
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   552
  >     h.update(rawtext)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   553
  >     return h.hexdigest()[:4]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   554
  > def reposetup(ui, repo):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   555
  >     # these 2 files are interesting
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   556
  >     for name in ['l', 's']:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   557
  >         fl = repo.file(name)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   558
  >         if len(fl) == 0:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   559
  >             continue
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   560
  >         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
   561
  >         texts = [fl.revision(i, raw=True) for i in fl]
35101
eb4241f914a3 test-lfs: cast the flags printed to an int
Matt Harbison <matt_harbison@yahoo.com>
parents: 35098
diff changeset
   562
  >         flags = [int(fl.flags(i)) for i in fl]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   563
  >         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
   564
  >         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
   565
  >               % (name, sizes, flags, hashes))
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   566
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   567
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   568
  $ 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
   569
  >          repo10; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   570
  >   echo 'repo:' $i
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   571
  >   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
   572
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   573
  repo: client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   574
  repo: client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   575
  repo: server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   576
  repo: repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   577
    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
   578
    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
   579
  repo: repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   580
    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
   581
    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
   582
  repo: repo5
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   583
    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
   584
    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
   585
  repo: repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   586
  repo: repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   587
  repo: repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   588
  repo: repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   589
  repo: repo10
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   590
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   591
repo12 doesn't have any cached lfs files and its source never pushed its
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   592
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: 35278
diff changeset
   593
the user cache.
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   594
35447
e28dedf4ff43 tests: fix the check-code rule for testing non-existent files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35393
diff changeset
   595
  $ test -d $TESTTMP/repo12/.hg/store/lfs/objects
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   596
  [1]
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   597
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   598
  $ hg --config extensions.share= share repo12 repo13
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   599
  updating working directory
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   600
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   601
  $ hg -R repo13 -q verify
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   602
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   603
  $ hg clone repo12 repo14
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   604
  updating to branch default
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   605
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   606
  $ hg -R repo14 -q verify
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   607
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   608
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: 35278
diff changeset
   609
--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: 35278
diff changeset
   610
remote store.
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   611
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   612
  $ rm -rf $TESTTMP/repo14/.hg/store/lfs
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   613
  $ hg init repo15
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   614
  $ hg -R repo14 push repo15
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   615
  pushing to repo15
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   616
  searching for changes
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   617
  adding changesets
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   618
  adding manifests
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   619
  adding file changes
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   620
  added 3 changesets with 2 changes to 1 files
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   621
  $ hg -R repo14 -q verify
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   622
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   623
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: 35473
diff changeset
   624
hardlinks.)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   625
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   626
  $ 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: 35473
diff changeset
   627
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   628
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: 35473
diff changeset
   629
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   630
  $ hg -R repo5 verify
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   631
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   632
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   633
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   634
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   635
   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: 35473
diff changeset
   636
   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: 35473
diff changeset
   637
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   638
  2 integrity errors encountered!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   639
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   640
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   641
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   642
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: 35473
diff changeset
   643
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: 35473
diff changeset
   644
because they aren't accessed.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   645
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   646
  $ hg clone -v repo5 fromcorrupt
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   647
  updating to branch default
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   648
  resolving manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   649
  getting l
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   650
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   651
  getting s
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   652
  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: 35473
diff changeset
   653
  $ 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: 35473
diff changeset
   654
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   655
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   656
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: 35473
diff changeset
   657
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: 35473
diff changeset
   658
the (uncorrupted) remote store.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   659
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   660
  $ 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: 35473
diff changeset
   661
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   662
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   663
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   664
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   665
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   666
  lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   667
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   668
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   669
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   670
  lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   671
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   672
  lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   673
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   674
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   675
35477
bb6a80fc969a lfs: only hardlink between the usercache and local store if the blob verifies
Matt Harbison <matt_harbison@yahoo.com>
parents: 35476
diff changeset
   676
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: 35476
diff changeset
   677
store, and poison it.  (The verify with a good remote now works.)
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   678
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   679
  $ 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: 35473
diff changeset
   680
  $ hg -R fromcorrupt verify -v
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   681
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   682
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   683
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   684
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   685
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   686
   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: 35473
diff changeset
   687
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   688
   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: 35473
diff changeset
   689
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   690
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   691
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   692
  2 integrity errors encountered!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   693
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   694
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   695
  $ 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: 35473
diff changeset
   696
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   697
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   698
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   699
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   700
  checking files
35477
bb6a80fc969a lfs: only hardlink between the usercache and local store if the blob verifies
Matt Harbison <matt_harbison@yahoo.com>
parents: 35476
diff changeset
   701
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   702
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   703
  lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   704
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   705
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   706
  4 files, 5 changesets, 10 total revisions
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   707
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   708
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: 35473
diff changeset
   709
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   710
  $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   711
  $ 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: 35473
diff changeset
   712
  updating to branch default
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   713
  resolving manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   714
  getting l
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   715
  abort: detected corrupt lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   716
  (run hg verify)
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   717
  [255]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   718
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   719
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: 35474
diff changeset
   720
usercache or local store.
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   721
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   722
  $ 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: 35474
diff changeset
   723
  [1]
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   724
  $ 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: 35474
diff changeset
   725
  [1]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   726
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   727
  $ hg -R fromcorrupt2 verify
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   728
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   729
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   730
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   731
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   732
   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: 35473
diff changeset
   733
   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: 35473
diff changeset
   734
  4 files, 5 changesets, 10 total revisions
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   735
  2 integrity errors encountered!
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   736
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   737
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   738
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   739
Corrupt local files are not sent upstream.  (The alternate dummy remote
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   740
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: 35473
diff changeset
   741
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   742
  $ mkdir $TESTTMP/dummy-remote2
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   743
  $ hg init dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   744
  $ 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: 35473
diff changeset
   745
  pushing to dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   746
  searching for changes
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   747
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   748
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   749
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   750
  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: 35474
diff changeset
   751
  (run hg verify)
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   752
  [255]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   753
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   754
  $ 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: 35473
diff changeset
   755
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   756
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   757
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   758
  crosschecking files in changesets and manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   759
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   760
   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: 35473
diff changeset
   761
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   762
   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: 35473
diff changeset
   763
  lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   764
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   765
  4 files, 5 changesets, 10 total revisions
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   766
  2 integrity errors encountered!
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   767
  (first damaged changeset appears to be 0)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   768
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   769
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   770
  $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   771
  sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   772
  $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256
35476
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   773
  sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
417e8e040102 lfs: verify lfs object content when transferring to and from the remote store
Matt Harbison <matt_harbison@yahoo.com>
parents: 35474
diff changeset
   774
  $ 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: 35474
diff changeset
   775
  [1]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   776
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   777
Accessing a corrupt file will complain
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   778
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   779
  $ hg --cwd fromcorrupt2 cat -r 0 large
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   780
  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: 35473
diff changeset
   781
  [255]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   782
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   783
lfs -> normal -> lfs round trip conversions are possible.  The threshold for the
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   784
lfs destination is specified here because it was originally listed in the local
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   785
.hgrc, and the global one is too high to trigger lfs usage.  For lfs -> normal,
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   786
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: 35175
diff changeset
   787
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   788
XXX: There's not a great way to ensure that the conversion to normal files
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   789
actually converts _everything_ to normal.  The extension needs to be loaded for
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   790
the source, but there's no way to disable it for the destination.  The best that
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   791
can be done is to raise the threshold so that lfs isn't used on the destination.
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   792
It doesn't like using '!' to unset the value on the command line.
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   793
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   794
  $ 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: 35175
diff changeset
   795
  >    convert repo8 convert_normal
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   796
  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: 35175
diff changeset
   797
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   798
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   799
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   800
  2 a
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   801
  1 b
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   802
  0 meta
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   803
  $ 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: 35175
diff changeset
   804
  [1]
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   805
  $ hg --cwd convert_normal debugdata a1 0
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   806
  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: 35175
diff changeset
   807
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   808
  $ 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: 35175
diff changeset
   809
  >    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: 35175
diff changeset
   810
  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: 35175
diff changeset
   811
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   812
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   813
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   814
  2 a
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   815
  1 b
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   816
  0 meta
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   817
  $ 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: 35175
diff changeset
   818
  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: 35175
diff changeset
   819
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   820
  size 29
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   821
  x-is-binary 0
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   822
  $ 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: 35175
diff changeset
   823
  lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   824
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   825
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: 35175
diff changeset
   826
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   827
  $ 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: 35175
diff changeset
   828
  >    convert repo3 convert_normal2
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   829
  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: 35175
diff changeset
   830
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   831
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   832
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   833
  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: 35175
diff changeset
   834
  3 renames
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   835
  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: 35175
diff changeset
   836
  1 random modifications
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   837
  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: 35175
diff changeset
   838
  $ 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: 35175
diff changeset
   839
  [1]
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   840
  $ 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: 35175
diff changeset
   841
  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: 35175
diff changeset
   842
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   843
  $ 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: 35175
diff changeset
   844
  >    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: 35175
diff changeset
   845
  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: 35175
diff changeset
   846
  scanning source...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   847
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   848
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   849
  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: 35175
diff changeset
   850
  3 renames
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   851
  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: 35175
diff changeset
   852
  1 random modifications
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   853
  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: 35175
diff changeset
   854
  $ 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: 35175
diff changeset
   855
  lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   856
  $ 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: 35175
diff changeset
   857
  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: 35175
diff changeset
   858
  oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   859
  size 39
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
   860
  x-is-binary 0
35215
8887a45e3384 lfs: enable the extension locally after converting to an 'lfs' repo
Matt Harbison <matt_harbison@yahoo.com>
parents: 35214
diff changeset
   861
8887a45e3384 lfs: enable the extension locally after converting to an 'lfs' repo
Matt Harbison <matt_harbison@yahoo.com>
parents: 35214
diff changeset
   862
  $ 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: 35214
diff changeset
   863
  $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob)
35452
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   864
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   865
Committing deleted files works:
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   866
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   867
  $ hg init $TESTTMP/repo-del
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   868
  $ cd $TESTTMP/repo-del
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   869
  $ echo 1 > A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   870
  $ hg commit -m 'add A' -A A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   871
  $ hg rm A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
   872
  $ hg commit -m 'rm A'
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   873
  $ cd ..
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   874
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   875
TODO: Unbundling adds a requirement to a non-lfs repo, if necessary.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   876
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   877
  $ 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: 35477
diff changeset
   878
  $ 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: 35477
diff changeset
   879
  $ hg init unbundle
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   880
  $ hg pull -R unbundle -q nolfs.hg
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   881
  $ grep lfs unbundle/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   882
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   883
  $ hg pull -R unbundle -q lfs.hg
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   884
  $ grep lfs unbundle/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   885
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   886
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   887
  $ hg init no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   888
  $ cat >> no_lfs/.hg/hgrc <<EOF
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   889
  > [experimental]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   890
  > changegroup3 = True
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   891
  > [extensions]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   892
  > lfs=!
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   893
  > EOF
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   894
  $ cp -R no_lfs no_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   895
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   896
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: 35477
diff changeset
   897
with lfs disabled, fails.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   898
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   899
  $ hg push -R convert_lfs2 no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   900
  pushing to no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   901
  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: 35477
diff changeset
   902
  [255]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   903
  $ grep lfs no_lfs/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   904
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   905
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   906
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: 35477
diff changeset
   907
with lfs disabled, fails.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   908
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   909
  $ hg pull -R no_lfs2 convert_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   910
  pulling from convert_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   911
  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: 35477
diff changeset
   912
  [255]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   913
  $ grep lfs no_lfs2/.hg/requires
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   914
  [1]