tests/test-lfs.t
author Raphaël Gomès <rgomes@octobus.net>
Tue, 18 Apr 2023 11:40:57 +0200
branchstable
changeset 50349 98ddff854d8a
parent 49826 c84844cd523a
child 50725 7e5be4a7cda7
permissions -rw-r--r--
Added tag 6.4.2 for changeset f952be90b051
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
38021
538e850ae737 tests: mark tests that fail when using chg as #require no-chg
Kyle Lippincott <spectral@google.com>
parents: 37445
diff changeset
     1
#require no-reposimplestore no-chg
37348
f4e84dfc06fd tests: skip largefiles and lfs tests when using simple store
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36760
diff changeset
     2
39852
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     3
  $ hg init requirements
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     4
  $ cd requirements
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     5
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     6
# LFS not loaded by default.
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     7
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     8
  $ hg config extensions
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
     9
  [1]
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    10
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    11
# Adding lfs to requires file will auto-load lfs extension.
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    12
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    13
  $ echo lfs >> .hg/requires
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    14
  $ hg config extensions
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    15
  extensions.lfs=
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    16
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    17
# But only if there is no config entry for the extension already.
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    18
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    19
  $ cat > .hg/hgrc << EOF
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    20
  > [extensions]
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    21
  > lfs=!
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    22
  > EOF
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    23
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    24
  $ hg config extensions
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45895
diff changeset
    25
  abort: repository requires features unknown to this Mercurial: lfs
39852
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    26
  (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    27
  [255]
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    28
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    29
  $ cat > .hg/hgrc << EOF
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    30
  > [extensions]
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    31
  > lfs=
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    32
  > EOF
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    33
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    34
  $ hg config extensions
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    35
  extensions.lfs=
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    36
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    37
  $ cat > .hg/hgrc << EOF
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    38
  > [extensions]
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    39
  > lfs = missing.py
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    40
  > EOF
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    41
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    42
  $ hg config extensions
48360
e4acdf5d94a2 extensions: highlight the name of the faulty extensions in the error message
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 47160
diff changeset
    43
  \*\*\* failed to import extension "lfs" from missing.py: [Errno *] $ENOENT$: 'missing.py' (glob)
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45895
diff changeset
    44
  abort: repository requires features unknown to this Mercurial: lfs
39852
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    45
  (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    46
  [255]
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    47
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    48
  $ cd ..
2c2fadbc9851 localrepo: automatically load lfs extension when required (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39707
diff changeset
    49
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    50
# Initial setup
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    51
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    52
  $ cat >> $HGRCPATH << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    53
  > [extensions]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    54
  > lfs=
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    55
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
    56
  > # Test deprecated config
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    57
  > threshold=1000B
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    58
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    59
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    60
  $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    61
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    62
# Prepare server and enable extension
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    63
  $ hg init server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    64
  $ hg clone -q server client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    65
  $ cd client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    66
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    67
# Commit small file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    68
  $ echo s > smallfile
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
    69
  $ echo '**.py = LF' > .hgeol
35800
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    70
  $ hg --config lfs.track='"size(\">1000B\")"' commit -Aqm "add small file"
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    71
  hg: parse error: unsupported file pattern: size(">1000B")
d5288b966e2f minifileset: note the unsupported file pattern when raising a parse error
Matt Harbison <matt_harbison@yahoo.com>
parents: 35799
diff changeset
    72
  (paths must be prefixed with "path:")
45895
fc4fb2f17dd4 errors: use exit code 10 for parse errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45894
diff changeset
    73
  [10]
35799
b91bca85ba73 lfs: don't automatically exclude '.hg*' files from external tracking
Matt Harbison <matt_harbison@yahoo.com>
parents: 35798
diff changeset
    74
  $ hg --config lfs.track='size(">1000B")' commit -Aqm "add small file"
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
# Commit large file
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    77
  $ echo $LONG > largefile
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
    78
  $ hg debugrequires | grep lfs
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
    79
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    80
  $ hg commit --traceback -Aqm "add large file"
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
    81
  $ hg debugrequires | grep lfs
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
    82
  lfs
35098
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
# Ensure metadata is stored
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    85
  $ hg debugdata largefile 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    86
  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
    87
  oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    88
  size 1501
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    89
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    90
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    91
# Check the blobstore is populated
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    92
  $ find .hg/store/lfs/objects | sort
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    93
  .hg/store/lfs/objects
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    94
  .hg/store/lfs/objects/f1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    95
  .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    96
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
    97
# 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
    98
  $ 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
    99
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   100
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   101
# Push changes to the server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   102
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   103
  $ hg push
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35376
diff changeset
   104
  pushing to $TESTTMP/server
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   105
  searching for changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   106
  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
   107
  [255]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   108
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   109
  $ cat >> $HGRCPATH << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   110
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   111
  > url=file:$TESTTMP/dummy-remote/
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   112
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   113
35504
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35502
diff changeset
   114
Push to a local non-lfs repo with the extension enabled will add the
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   115
lfs requirement
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   116
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   117
  $ hg debugrequires -R $TESTTMP/server/ | grep lfs
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   118
  [1]
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   119
  $ 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
   120
  pushing to $TESTTMP/server
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   121
  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
   122
  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
   123
  2 changesets found
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   124
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   125
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   126
  adding file changes
42897
d7304434390f changegroup: move message about added changes to transaction summary
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 42776
diff changeset
   127
  calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   128
  added 2 changesets with 3 changes to 3 files
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   129
  $ hg debugrequires -R $TESTTMP/server/ | grep lfs
35504
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35502
diff changeset
   130
  lfs
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   131
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   132
# Unknown URL scheme
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   133
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   134
  $ 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
   135
  abort: lfs: unknown url scheme: ftp
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   136
  [255]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   137
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   138
  $ cd ../
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   139
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   140
# 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
   141
  $ hg init client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   142
  $ cd client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   143
  $ cat >> .hg/hgrc <<EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   144
  > [paths]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   145
  > default = $TESTTMP/server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   146
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   147
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   148
# Pull from server
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   149
35504
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35502
diff changeset
   150
Pulling a local lfs repo into a local non-lfs repo with the extension
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35502
diff changeset
   151
enabled adds the lfs requirement
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
   152
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   153
  $ hg debugrequires | grep lfs || true
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   154
  $ hg debugrequires -R $TESTTMP/server/ | grep lfs
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   155
  lfs
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   156
  $ hg pull default
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 35376
diff changeset
   157
  pulling from $TESTTMP/server
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   158
  requesting all changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   159
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   160
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   161
  adding file changes
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   162
  added 2 changesets with 3 changes to 3 files
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   163
  new changesets 0ead593177f7:b88141481348
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   164
  (run 'hg update' to get a working copy)
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   165
  $ hg debugrequires | grep lfs
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   166
  lfs
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   167
  $ hg debugrequires -R $TESTTMP/server/ | grep lfs
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   168
  lfs
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   169
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   170
# 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
   171
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   172
  [1]
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
# 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
   175
  $ hg update
35648
588d02d9208a lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35618
diff changeset
   176
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   177
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   178
# 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
   179
  $ find .hg/store/lfs/objects | sort
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   180
  .hg/store/lfs/objects
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   181
  .hg/store/lfs/objects/f1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   182
  .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   183
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   184
# 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
   185
  $ hg cat -r . largefile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   186
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   187
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   188
# 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
   189
  $ cat largefile
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   190
  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   191
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   192
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   193
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   194
# 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
   195
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   196
  $ hg init repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   197
  $ cd repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   198
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   199
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   200
  > track=size(">10B")
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   201
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   202
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   203
  $ 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
   204
  $ echo SHORTER > small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   205
  $ hg add . -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   206
  $ 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
   207
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   208
  $ hg files -r . 'set:added()'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   209
  large
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   210
  small
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   211
  $ hg files -r . 'set:added() & lfs()'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   212
  large
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   213
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   214
  $ hg mv large l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   215
  $ hg mv small s
36000
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   216
  $ hg status 'set:removed()'
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   217
  R large
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   218
  R small
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   219
  $ hg status 'set:removed() & lfs()'
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   220
  R large
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   221
  $ hg commit -m 'renames'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   222
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   223
  $ hg cat -r . l -T '{rawdata}\n'
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   224
  version https://git-lfs.github.com/spec/v1
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   225
  oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   226
  size 39
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   227
  x-hg-copy large
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   228
  x-hg-copyrev 2c531e0992ff3107c511b53cb82a91b6436de8b2
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   229
  x-is-binary 0
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   230
  
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   231
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   232
  $ hg files -r . 'set:copied()'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   233
  l
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   234
  s
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   235
  $ hg files -r . 'set:copied() & lfs()'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   236
  l
36000
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   237
  $ hg status --change . 'set:removed()'
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   238
  R large
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   239
  R small
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   240
  $ hg status --change . 'set:removed() & lfs()'
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
   241
  R large
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
   242
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   243
  $ echo SHORT > l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   244
  $ echo BECOME-LARGER-FROM-SHORTER > s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   245
  $ 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
   246
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   247
  $ echo 1 >> l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   248
  $ echo 2 >> s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   249
  $ hg commit -m 'random modifications'
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   250
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   251
  $ echo RESTORE-TO-BE-LARGE > l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   252
  $ echo SHORTER > s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   253
  $ 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
   254
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   255
# Test lfs_files template
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   256
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   257
  $ 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
   258
  0 large
35999
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
   259
  1 l, large
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   260
  2 s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   261
  3 s
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   262
  4 l
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   263
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   264
# Push and pull the above repo
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   265
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   266
  $ hg --cwd .. init repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   267
  $ hg push ../repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   268
  pushing to ../repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   269
  searching for changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   270
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   271
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   272
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   273
  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
   274
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   275
  $ hg --cwd .. init repo5
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   276
  $ hg --cwd ../repo5 pull ../repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   277
  pulling from ../repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   278
  requesting all changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   279
  adding changesets
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   280
  adding manifests
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   281
  adding file changes
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   282
  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
   283
  new changesets fd47a419c4f7:5adf850972b9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   284
  (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
   285
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   286
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   287
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   288
# Test clone
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   289
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   290
  $ hg init repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   291
  $ cd repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   292
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   293
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   294
  > track=size(">30B")
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   295
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   296
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   297
  $ 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
   298
  $ echo SMALL > small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   299
  $ 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
   300
  $ 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
   301
  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
   302
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   303
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   304
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   305
  $ hg clone repo6 repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   306
  updating to branch default
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   307
  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
   308
  $ cd repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   309
  $ cat large
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   310
  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
   311
  $ cat small
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   312
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   313
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   314
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   315
35214
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35213
diff changeset
   316
  $ 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
   317
  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
   318
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
   319
  $ hg debugrequires -R sharedrepo/ | grep lfs
39853
bcf72d7b1524 lfs: don't add extension to hgrc after clone or share (BC)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39852
diff changeset
   320
  lfs
35214
a8c778b2a689 lfs: enable the extension locally after sharing a repo with 'lfs' requirement
Matt Harbison <matt_harbison@yahoo.com>
parents: 35213
diff changeset
   321
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   322
# Test rename and status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   323
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   324
  $ hg init repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   325
  $ cd repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   326
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   327
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   328
  > track=size(">10B")
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   329
  > EOF
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
  $ 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
   332
  $ echo SMALL > a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   333
  $ 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
   334
  $ hg status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   335
  $ hg mv a1 b1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   336
  $ hg mv a2 a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   337
  $ hg mv b1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   338
  $ hg commit -m b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   339
  $ 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
   340
  >>> with open('a2', 'wb') as f:
39951
a339b5e0d7c6 py3: suppress the output from .write() calls in more tests
Matt Harbison <matt_harbison@yahoo.com>
parents: 39950
diff changeset
   341
  ...     f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA') and None
35376
c7d49b87c1ee tests: use Python to write binary data in lfs test instead of shell
Augie Fackler <raf@durin42.com>
parents: 35334
diff changeset
   342
  >>> with open('a1', 'wb') as f:
39951
a339b5e0d7c6 py3: suppress the output from .write() calls in more tests
Matt Harbison <matt_harbison@yahoo.com>
parents: 39950
diff changeset
   343
  ...     f.write(b'\1\nMETA\n') and None
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   344
  $ hg commit -m meta
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   345
  $ hg status
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   346
  $ 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
   347
  2:  |  | 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   348
  1: a1 (a2)a2 (a1) |  | 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   349
  0:  |  | a1 a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   350
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   351
  $ for n in a1 a2; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   352
  >   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
   353
  >     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
   354
  >     hg debugdata $n $r
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   355
  >   done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   356
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   357
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   358
  a1 @ 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   359
  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
   360
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   361
  size 29
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   362
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   363
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   364
  a1 @ 1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   365
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   366
  copy: a2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   367
  copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   368
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   369
  SMALL
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
  a1 @ 2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   372
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   373
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   374
  \x01 (esc)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   375
  META
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   376
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   377
  a2 @ 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   378
  SMALL
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   379
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   380
  a2 @ 1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   381
  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
   382
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   383
  size 29
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   384
  x-hg-copy a1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   385
  x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   386
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   387
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   388
  a2 @ 2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   389
  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
   390
  oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   391
  size 32
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   392
  x-is-binary 0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   393
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   394
# Verify commit hashes include rename metadata
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   395
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   396
  $ 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
   397
  2:0fae949de7fa meta
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   398
  1:9cd6bdffdac0 b
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   399
  0:7f96794915f7 a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   400
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   401
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   402
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   403
# Test bundle
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
  $ hg init repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   406
  $ cd repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   407
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   408
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   409
  > track=size(">10B")
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   410
  > [diff]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   411
  > git=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   412
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   413
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   414
  $ 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
   415
  >   echo 'THIS-IS-LFS-'$i > a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   416
  >   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
   417
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   418
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   419
  $ hg update 2 -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   420
  $ 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
   421
  $ hg commit -m branching -q
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   422
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   423
  $ 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
   424
  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
   425
  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
   426
  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
   427
  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
   428
  4 changesets found
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   429
  uncompressed size of bundle content:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   430
       * (changelog) (glob)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   431
       * (manifests) (glob)
36743
d031609b3cb7 changegroup: do not delta lfs revisions
Jun Wu <quark@fb.com>
parents: 35807
diff changeset
   432
      * a (glob)
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   433
  $ 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
   434
  $ 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
   435
  5 branching
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   436
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   437
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   438
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   439
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   440
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   441
  +THIS-IS-LFS-2-CHILD
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   442
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   443
  4 a-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   444
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   445
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   446
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   447
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   448
  -THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   449
  +THIS-IS-LFS-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   450
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   451
  3 a-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   452
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   453
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   454
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   455
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   456
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   457
  +THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   458
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   459
  2 a-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   460
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   461
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   462
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   463
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   464
  -THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   465
  +THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   466
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   467
  1 a-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   468
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   469
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   470
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   471
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   472
  -THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   473
  +THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   474
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   475
  0 a-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   476
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   477
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   478
  --- /dev/null
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   479
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   480
  @@ -0,0 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   481
  +THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   482
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   483
  $ 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
   484
  $ 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
   485
  5 branching
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   486
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   487
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   488
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   489
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   490
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   491
  +THIS-IS-LFS-2-CHILD
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   492
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   493
  4 a-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   494
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   495
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   496
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   497
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   498
  -THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   499
  +THIS-IS-LFS-4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   500
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   501
  3 a-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   502
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   503
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   504
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   505
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   506
  -THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   507
  +THIS-IS-LFS-three
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   508
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   509
  2 a-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   510
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   511
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   512
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   513
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   514
  -THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   515
  +THIS-IS-LFS-two
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   516
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   517
  1 a-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   518
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   519
  --- a/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   520
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   521
  @@ -1,1 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   522
  -THIS-IS-LFS-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   523
  +THIS-IS-LFS-single
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   524
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   525
  0 a-0
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   526
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   527
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   528
  --- /dev/null
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   529
  +++ b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   530
  @@ -0,0 +1,1 @@
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   531
  +THIS-IS-LFS-0
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
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   534
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   535
# Test isbinary
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   536
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   537
  $ hg init repo10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   538
  $ cd repo10
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   539
  $ cat >> .hg/hgrc << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   540
  > [extensions]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   541
  > lfs=
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   542
  > [lfs]
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   543
  > track=all()
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   544
  > EOF
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 39489
diff changeset
   545
  $ "$PYTHON" <<'EOF'
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   546
  > def write(path, content):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   547
  >     with open(path, 'wb') as f:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   548
  >         f.write(content)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   549
  > write('a', b'\0\0')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   550
  > write('b', b'\1\n')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   551
  > write('c', b'\1\n\0')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   552
  > write('d', b'xx')
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   553
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   554
  $ hg add a b c d
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   555
  $ hg diff --stat
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   556
   a |  Bin 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   557
   b |    1 +
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   558
   c |  Bin 
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   559
   d |    1 +
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   560
   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
   561
  $ hg commit -m binarytest
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   562
  $ cat > $TESTTMP/dumpbinary.py << EOF
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   563
  > from mercurial.utils import (
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   564
  >     stringutil,
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   565
  > )
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   566
  > def reposetup(ui, repo):
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   567
  >     for n in (b'a', b'b', b'c', b'd'):
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   568
  >         ui.write((b'%s: binary=%s\n')
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   569
  >                   % (n, stringutil.pprint(repo[b'.'][n].isbinary())))
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   570
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   571
  $ 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
   572
  a: binary=True
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   573
  b: binary=False
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   574
  c: binary=True
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   575
  d: binary=False
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   576
  b55353847f02 tip
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   577
38414
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   578
Binary blobs don't need to be present to be skipped in filesets.  (And their
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   579
absence doesn't cause an abort.)
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   580
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   581
  $ rm .hg/store/lfs/objects/96/a296d224f285c67bee93c30f8a309157f0daa35dc5b87e410b78630a09cfc7
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   582
  $ rm .hg/store/lfs/objects/92/f76135a4baf4faccb8586a60faf830c2bdfce147cefa188aaf4b790bd01b7e
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   583
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   584
  $ hg files --debug -r . 'set:eol("unix")' --config 'experimental.lfs.disableusercache=True'
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   585
  lfs: found c04b5bb1a5b2eb3e9cd4805420dba5a9d133da5b7adeeafb5474c4adae9faa80 in the local lfs store
38689
ff5b6fca1082 fileset: rewrite predicates to return matcher not closed to subset (API) (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 38415
diff changeset
   586
           2   b
38414
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   587
  lfs: found 5dde896887f6754c9b15bfe3a441ae4806df2fde94001311e08bf110622e0bbe in the local lfs store
235d0bc11e1d fileset: use filectx.isbinary() to filter out binaries in eol()
Matt Harbison <matt_harbison@yahoo.com>
parents: 38021
diff changeset
   588
38415
6fcbab5c1e6e test-lfs: add coverage for the binary() fileset
Matt Harbison <matt_harbison@yahoo.com>
parents: 38414
diff changeset
   589
  $ hg files --debug -r . 'set:binary()' --config 'experimental.lfs.disableusercache=True'
6fcbab5c1e6e test-lfs: add coverage for the binary() fileset
Matt Harbison <matt_harbison@yahoo.com>
parents: 38414
diff changeset
   590
           2   a
6fcbab5c1e6e test-lfs: add coverage for the binary() fileset
Matt Harbison <matt_harbison@yahoo.com>
parents: 38414
diff changeset
   591
           3   c
6fcbab5c1e6e test-lfs: add coverage for the binary() fileset
Matt Harbison <matt_harbison@yahoo.com>
parents: 38414
diff changeset
   592
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   593
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   594
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   595
# 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
   596
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   597
  $ hg init repo12
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   598
  $ cd repo12
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   599
  $ cat >> .hg/hgrc <<EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   600
  > [lfs]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   601
  > threshold=1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   602
  > 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
   603
  $ 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
   604
  > # 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
   605
  > 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
   606
  > 
5be1a5e869c1 test-lfs: perform the `chmod +x` command in a manner compatible with Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 35101
diff changeset
   607
  > 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
   608
  > 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
   609
  > 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
   610
  > 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
   611
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   612
  $ 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
   613
  >     cp ../repo10/a a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   614
  >     if [ $i = 3 ]; then
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   615
  >         # 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
   616
  >         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
   617
  >         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
   618
  >         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
   619
  >     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
   620
  >         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
   621
  >         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
   622
  >     fi
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   623
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   624
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   625
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   626
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   627
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   628
  $ hg clone repo12 repo13 --noupdate
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   629
  $ cd repo13
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   630
  $ 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
   631
  2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   632
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   633
  old mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   634
  new mode 100755
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   635
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   636
  2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   637
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   638
  Binary file a has changed
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   639
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   640
  1
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   641
  diff --git a/a b/a
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   642
  new file mode 100644
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   643
  Binary file a has changed
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   644
  
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   645
  $ [ -d .hg/store/lfs/objects ]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   646
  [1]
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   647
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   648
  $ cd ..
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   649
35618
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   650
# Test filter
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   651
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   652
  $ hg init repo11
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   653
  $ cd repo11
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   654
  $ cat >> .hg/hgrc << EOF
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   655
  > [lfs]
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   656
  > track=(**.a & size(">5B")) | (**.b & !size(">5B"))
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   657
  >      | (**.c & "path:d" & !"path:d/c.c") | size(">10B")
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   658
  > EOF
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   659
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   660
  $ mkdir a
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   661
  $ echo aaaaaa > a/1.a
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   662
  $ echo a > a/2.a
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   663
  $ echo aaaaaa > 1.b
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   664
  $ echo a > 2.b
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   665
  $ echo a > 1.c
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   666
  $ mkdir d
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   667
  $ echo a > d/c.c
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   668
  $ echo a > d/d.c
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   669
  $ echo aaaaaaaaaaaa > x
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   670
  $ hg add . -q
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   671
  $ hg commit -m files
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   672
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   673
  $ for p in a/1.a a/2.a 1.b 2.b 1.c d/c.c d/d.c x; do
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   674
  >   if hg debugdata $p 0 2>&1 | grep git-lfs >/dev/null; then
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   675
  >     echo "${p}: is lfs"
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   676
  >   else
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   677
  >     echo "${p}: not lfs"
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   678
  >   fi
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   679
  > done
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   680
  a/1.a: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   681
  a/2.a: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   682
  1.b: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   683
  2.b: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   684
  1.c: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   685
  d/c.c: not lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   686
  d/d.c: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   687
  x: is lfs
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   688
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   689
  $ cd ..
c780e0649e41 lfs: migrate most file filtering from threshold to custom filter
Matt Harbison <matt_harbison@yahoo.com>
parents: 35617
diff changeset
   690
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   691
# Verify the repos
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   692
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   693
  $ cat > $TESTTMP/dumpflog.py << EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   694
  > # 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
   695
  > import hashlib
36645
7bc33d677c0c tests: fix various test-check-module-imports.t violations
Augie Fackler <augie@google.com>
parents: 36000
diff changeset
   696
  > from mercurial.node import short
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   697
  > from mercurial import (
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   698
  >     pycompat,
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   699
  >     revlog,
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   700
  > )
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   701
  > from mercurial.utils import (
45055
4c1b4805db57 pycompat: change users of pycompat.{stdin,stdout,stderr} to use procutil.std*
Manuel Jacob <me@manueljacob.de>
parents: 44111
diff changeset
   702
  >     procutil,
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   703
  >     stringutil,
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   704
  > )
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   705
  > def hash(rawtext):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   706
  >     h = hashlib.sha512()
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   707
  >     h.update(rawtext)
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   708
  >     return pycompat.sysbytes(h.hexdigest()[:4])
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   709
  > def reposetup(ui, repo):
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   710
  >     # these 2 files are interesting
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   711
  >     for name in [b'l', b's']:
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   712
  >         fl = repo.file(name)
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   713
  >         if len(fl) == 0:
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   714
  >             continue
39875
d909c44d29e1 filelog: stop proxying rawsize() (API)
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39855
diff changeset
   715
  >         sizes = [fl._revlog.rawsize(i) for i in fl]
42776
5769ed8fa5f4 rawdata: update callers in lfs' tests
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 40368
diff changeset
   716
  >         texts = [fl.rawdata(i) for i in fl]
39855
62a532045e71 lfs: access revlog directly
Gregory Szorc <gregory.szorc@gmail.com>
parents: 39853
diff changeset
   717
  >         flags = [int(fl._revlog.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
   718
  >         hashes = [hash(t) for t in texts]
45055
4c1b4805db57 pycompat: change users of pycompat.{stdin,stdout,stderr} to use procutil.std*
Manuel Jacob <me@manueljacob.de>
parents: 44111
diff changeset
   719
  >         procutil.stdout.write(b'  %s: rawsizes=%r flags=%r hashes=%s\n'
39950
8d41097dfe7d py3: byteify test-lfs.t
Matt Harbison <matt_harbison@yahoo.com>
parents: 39949
diff changeset
   720
  >                               % (name, sizes, flags, stringutil.pprint(hashes)))
35098
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   721
  > EOF
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   722
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   723
  $ 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
   724
  >          repo10; do
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   725
  >   echo 'repo:' $i
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   726
  >   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
   727
  > done
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   728
  repo: client
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   729
  repo: client2
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   730
  repo: server
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   731
  repo: repo3
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   732
    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
   733
    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
   734
  repo: repo4
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   735
    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
   736
    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
   737
  repo: repo5
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   738
    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
   739
    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
   740
  repo: repo6
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   741
  repo: repo7
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   742
  repo: repo8
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   743
  repo: repo9
66c5a8cf2868 lfs: import the Facebook git-lfs client extension
Matt Harbison <matt_harbison@yahoo.com>
parents:
diff changeset
   744
  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
   745
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   746
repo13 doesn't have any cached lfs files and its source never pushed its
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   747
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
   748
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
   749
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   750
  $ test -d $TESTTMP/repo13/.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
   751
  [1]
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   752
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   753
  $ hg --config extensions.share= share repo13 repo14
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   754
  updating working directory
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   755
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   756
  $ hg -R repo14 -q verify
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   757
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   758
  $ hg clone repo13 repo15
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   759
  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
   760
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   761
  $ hg -R repo15 -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
   762
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   763
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
   764
--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
   765
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
   766
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   767
  $ rm -rf $TESTTMP/repo15/.hg/store/lfs
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   768
  $ hg init repo16
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   769
  $ hg -R repo15 push repo16
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   770
  pushing to repo16
35278
0768708589ef lfs-test: note a problem with unpushed lfs files and cloning/sharing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35215
diff changeset
   771
  searching for changes
35280
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   772
  adding changesets
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   773
  adding manifests
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   774
  adding file changes
8e72f9152c4d lfs: introduce a user level cache for lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35278
diff changeset
   775
  added 3 changesets with 2 changes to 1 files
35617
b75ea116603d test-lfs: bump the number on test repo11 and higher
Matt Harbison <matt_harbison@yahoo.com>
parents: 35552
diff changeset
   776
  $ hg -R repo15 -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
   777
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   778
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
   779
hardlinks.)
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   780
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   781
  $ 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
   782
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   783
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
   784
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   785
  $ hg -R repo5 verify
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   786
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   787
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   788
  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
   789
  checking files
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   790
   l@1: unpacking 46a2f24864bc: integrity check failed on l:0
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   791
   large@0: unpacking 2c531e0992ff: integrity check failed on large:0
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   792
  not checking dirstate because of previous errors
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38689
diff changeset
   793
  checked 5 changesets with 10 changes to 4 files
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   794
  2 integrity errors encountered!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   795
  (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
   796
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   797
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   798
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
   799
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
   800
because they aren't accessed.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   801
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   802
  $ hg clone -v repo5 fromcorrupt
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   803
  updating to branch default
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   804
  resolving manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   805
  getting l
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   806
  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
   807
  getting s
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   808
  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
   809
  $ 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
   810
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   811
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   812
Verify will not try to download lfs blobs, if told not to process lfs content.
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   813
The extension makes sure that the filelog.renamed() path is taken on a missing
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   814
blob, and the output shows that it isn't fetched.
44071
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   815
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   816
  $ cat > $TESTTMP/lfsrename.py <<EOF
44111
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   817
  > import sys
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   818
  > 
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   819
  > from mercurial import (
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   820
  >     exthelper,
44111
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   821
  >     pycompat,
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   822
  > )
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   823
  > 
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   824
  > from hgext.lfs import (
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   825
  >     pointer,
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   826
  >     wrapper,
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   827
  > )
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   828
  > 
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   829
  > eh = exthelper.exthelper()
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   830
  > uisetup = eh.finaluisetup
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   831
  > 
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   832
  > @eh.wrapfunction(wrapper, b'filelogrenamed')
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   833
  > def filelogrenamed(orig, orig1, self, node):
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   834
  >     ret = orig(orig1, self, node)
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   835
  >     if wrapper._islfs(self._revlog, node) and ret:
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   836
  >         rawtext = self._revlog.rawdata(node)
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   837
  >         metadata = pointer.deserialize(rawtext)
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   838
  >         print('lfs blob %s renamed %s -> %s'
44111
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   839
  >               % (pycompat.sysstr(metadata[b'oid']),
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   840
  >                  pycompat.sysstr(ret[0]),
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   841
  >                  pycompat.fsdecode(self._revlog.filename)))
2928d5af6281 py3: string normalization and I/O tweaks in test-lfs.t
Gregory Szorc <gregory.szorc@gmail.com>
parents: 44073
diff changeset
   842
  >         sys.stdout.flush()
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   843
  >     return ret
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   844
  > EOF
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   845
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   846
  $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v --no-lfs \
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   847
  >                   --config extensions.x=$TESTTMP/lfsrename.py
44071
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   848
  repository uses revlog format 1
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   849
  checking changesets
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   850
  checking manifests
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   851
  crosschecking files in changesets and manifests
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   852
  checking files
44072
1a6dd50cd0db lfs: don't skip locally available blobs when verifying
Matt Harbison <matt_harbison@yahoo.com>
parents: 44071
diff changeset
   853
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   854
  lfs blob sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e renamed large -> l
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   855
  checking dirstate
44071
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   856
  checked 5 changesets with 10 changes to 4 files
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   857
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   858
Verify will not try to download lfs blobs, if told not to by the config option
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   859
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   860
  $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v \
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   861
  >                   --config verify.skipflags=8192 \
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   862
  >                   --config extensions.x=$TESTTMP/lfsrename.py
44071
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   863
  repository uses revlog format 1
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   864
  checking changesets
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   865
  checking manifests
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   866
  crosschecking files in changesets and manifests
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   867
  checking files
44072
1a6dd50cd0db lfs: don't skip locally available blobs when verifying
Matt Harbison <matt_harbison@yahoo.com>
parents: 44071
diff changeset
   868
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
44073
b9e174d4ed11 verify: allow the storage to signal when renames can be tested on `skipread`
Matt Harbison <matt_harbison@yahoo.com>
parents: 44072
diff changeset
   869
  lfs blob sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e renamed large -> l
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   870
  checking dirstate
44071
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   871
  checked 5 changesets with 10 changes to 4 files
34e8305f02bd lfs: add a switch to `hg verify` to ignore the content of blobs
Matt Harbison <matt_harbison@yahoo.com>
parents: 43804
diff changeset
   872
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   873
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
   874
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
   875
the (uncorrupted) remote store.
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   876
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   877
  $ 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
   878
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   879
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   880
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   881
  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
   882
  checking files
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   883
  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
   884
  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
   885
  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
   886
  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
   887
  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
   888
  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
   889
  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
   890
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   891
  checking dirstate
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38689
diff changeset
   892
  checked 5 changesets with 10 changes to 4 files
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   893
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
   894
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
   895
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
   896
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   897
  $ 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
   898
  $ hg -R fromcorrupt verify -v
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   899
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   900
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   901
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   902
  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
   903
  checking files
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   904
   l@1: unpacking 46a2f24864bc: integrity check failed on l:0
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   905
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   906
   large@0: unpacking 2c531e0992ff: integrity check failed on large:0
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   907
  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
   908
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   909
  not checking dirstate because of previous errors
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38689
diff changeset
   910
  checked 5 changesets with 10 changes to 4 files
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   911
  2 integrity errors encountered!
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   912
  (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
   913
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   914
  $ 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
   915
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   916
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   917
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   918
  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
   919
  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
   920
  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
   921
  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
   922
  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
   923
  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
   924
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   925
  checking dirstate
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38689
diff changeset
   926
  checked 5 changesets with 10 changes to 4 files
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   927
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   928
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
   929
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   930
  $ 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
   931
  $ 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
   932
  updating to branch default
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   933
  resolving manifests
35552
fd610befc37f lfs: use the localstore download method to transfer from remote stores
Matt Harbison <matt_harbison@yahoo.com>
parents: 35504
diff changeset
   934
  abort: corrupt remote lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   935
  [255]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   936
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
   937
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
   938
usercache or local store.
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   939
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
   940
  $ 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
   941
  [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
   942
  $ 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
   943
  [1]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   944
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   945
  $ hg -R fromcorrupt2 verify
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   946
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   947
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   948
  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
   949
  checking files
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   950
   l@1: unpacking 46a2f24864bc: integrity check failed on l:0
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   951
   large@0: unpacking 2c531e0992ff: integrity check failed on large:0
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   952
  not checking dirstate because of previous errors
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38689
diff changeset
   953
  checked 5 changesets with 10 changes to 4 files
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
   954
  2 integrity errors encountered!
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   955
  (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
   956
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   957
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
   958
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
   959
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
   960
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   961
  $ mkdir $TESTTMP/dummy-remote2
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   962
  $ hg init dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   963
  $ 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
   964
  pushing to dest
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   965
  searching for changes
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   966
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b 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
   967
  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
   968
  (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
   969
  [255]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   970
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   971
  $ 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
   972
  repository uses revlog format 1
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   973
  checking changesets
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   974
  checking manifests
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   975
  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
   976
  checking files
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   977
   l@1: unpacking 46a2f24864bc: integrity check failed on l:0
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   978
  lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   979
   large@0: unpacking 2c531e0992ff: integrity check failed on large:0
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   980
  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
   981
  lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
49826
c84844cd523a verify: also check dirstate
Raphaël Gomès <rgomes@octobus.net>
parents: 49534
diff changeset
   982
  not checking dirstate because of previous errors
39489
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38689
diff changeset
   983
  checked 5 changesets with 10 changes to 4 files
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
   984
  2 integrity errors encountered!
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   985
  (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
   986
  [1]
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   987
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   988
  $ 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
   989
  sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   990
  $ 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
   991
  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
   992
  $ 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
   993
  [1]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   994
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   995
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
   996
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
   997
  $ hg --cwd fromcorrupt2 cat -r 0 large
49534
92892dff03f3 revlog: use the user facing filename as the display_id for filelogs
Matt Harbison <matt_harbison@yahoo.com>
parents: 48657
diff changeset
   998
  abort: integrity check failed on large:0
46116
17a695357270 errors: use detailed exit code 50 for StorageError
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   999
  [50]
35474
16660fd4428d test-lfs: add tests around corrupted lfs objects
Matt Harbison <matt_harbison@yahoo.com>
parents: 35473
diff changeset
  1000
35649
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
  1001
lfs -> normal -> lfs round trip conversions are possible.  The 'none()'
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
  1002
predicate on the command line will override whatever is configured globally and
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
  1003
locally, and ensures everything converts to a regular file.  For lfs -> normal,
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1004
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
  1005
35649
1f0690bfc683 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com>
parents: 35648
diff changeset
  1006
  $ hg --config extensions.convert= --config 'lfs.track=none()' \
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1007
  >    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
  1008
  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
  1009
  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
  1010
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1011
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1012
  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
  1013
  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
  1014
  0 meta
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1015
  $ hg debugrequires -R convert_normal | grep 'lfs'
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1016
  [1]
35663
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1017
  $ hg --cwd convert_normal cat a1 -r 0 -T '{rawdata}'
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1018
  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
  1019
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1020
  $ 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
  1021
  >    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
  1022
  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
  1023
  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
  1024
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1025
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1026
  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
  1027
  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
  1028
  0 meta
35663
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1029
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1030
  $ hg --cwd convert_lfs cat -r 0 a1 -T '{rawdata}'
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1031
  version https://git-lfs.github.com/spec/v1
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1032
  oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1033
  size 29
a985834961f7 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com>
parents: 35658
diff changeset
  1034
  x-is-binary 0
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1035
  $ 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
  1036
  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
  1037
  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
  1038
  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
  1039
  x-is-binary 0
35797
76cb752af07a lfs: rename {pointer} to {lfspointer}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35769
diff changeset
  1040
  $ hg --cwd convert_lfs log -r 0 -T "{lfs_files % '{lfspointer % '{key}={value}\n'}'}"
35731
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1041
  version=https://git-lfs.github.com/spec/v1
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1042
  oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1043
  size=29
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1044
  x-is-binary=0
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1045
  $ hg --cwd convert_lfs log -r 0 \
35797
76cb752af07a lfs: rename {pointer} to {lfspointer}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35769
diff changeset
  1046
  >    -T '{lfs_files % "{get(lfspointer, "oid")}\n"}{lfs_files % "{lfspointer.oid}\n"}'
35731
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1047
  sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1048
  sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
35797
76cb752af07a lfs: rename {pointer} to {lfspointer}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35769
diff changeset
  1049
  $ hg --cwd convert_lfs log -r 0 -T '{lfs_files % "{lfspointer}\n"}'
35731
f58245b9e3ea lfs: add the '{lfsattrs}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35665
diff changeset
  1050
  version=https://git-lfs.github.com/spec/v1 oid=sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 size=29 x-is-binary=0
35658
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
  1051
  $ hg --cwd convert_lfs \
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
  1052
  >     log -r 'all()' -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}'
35658
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
  1053
  0: a1: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
  1054
  1: a2: 5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024
a1222a8cc93b lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com>
parents: 35657
diff changeset
  1055
  2: a2: 876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943
35657
8580e5898cb7 lfs: convert '{lfs_files}' keyword to a hybrid list
Matt Harbison <matt_harbison@yahoo.com>
parents: 35650
diff changeset
  1056
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1057
  $ hg debugrequires -R convert_lfs | grep 'lfs'
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1058
  lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1059
35650
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1060
The hashes in all stages of the conversion are unchanged.
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1061
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1062
  $ hg -R repo8 log -T '{node|short}\n'
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1063
  0fae949de7fa
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1064
  9cd6bdffdac0
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1065
  7f96794915f7
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1066
  $ hg -R convert_normal log -T '{node|short}\n'
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1067
  0fae949de7fa
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1068
  9cd6bdffdac0
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1069
  7f96794915f7
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1070
  $ hg -R convert_lfs log -T '{node|short}\n'
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1071
  0fae949de7fa
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1072
  9cd6bdffdac0
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1073
  7f96794915f7
4568e98b5f45 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com>
parents: 35649
diff changeset
  1074
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1075
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
  1076
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1077
  $ 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
  1078
  >    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
  1079
  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
  1080
  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
  1081
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1082
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1083
  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
  1084
  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
  1085
  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
  1086
  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
  1087
  0 switch large and small again
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1088
  $ hg debugrequires -R convert_normal2 | grep 'lfs'
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1089
  [1]
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1090
  $ 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
  1091
  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
  1092
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1093
  $ 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
  1094
  >    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
  1095
  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
  1096
  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
  1097
  sorting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1098
  converting...
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1099
  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
  1100
  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
  1101
  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
  1102
  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
  1103
  0 switch large and small again
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1104
  $ hg debugrequires -R convert_lfs2 | grep 'lfs'
35178
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1105
  lfs
f8f939a2926c lfs: add a repo requirement for this extension when converting to lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35175
diff changeset
  1106
  $ 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
  1107
  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
  1108
  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
  1109
  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
  1110
  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
  1111
35452
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1112
Committing deleted files works:
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1113
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1114
  $ hg init $TESTTMP/repo-del
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1115
  $ cd $TESTTMP/repo-del
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1116
  $ echo 1 > A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1117
  $ 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
  1118
  $ hg rm A
488634db5928 lfs: fix committing deleted files caused by e0a1b9ee93cd
Jun Wu <quark@fb.com>
parents: 35447
diff changeset
  1119
  $ hg commit -m 'rm A'
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1120
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1121
Bad .hglfs files will block the commit with a useful message
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1122
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1123
  $ cat > .hglfs << EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1124
  > [track]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1125
  > **.test = size(">5B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1126
  > bad file ... no commit
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1127
  > EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1128
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1129
  $ echo x > file.txt
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1130
  $ hg ci -Aqm 'should fail'
45894
9dc1351d0b5f errors: raise ConfigError on failure to parse config file
Martin von Zweigbergk <martinvonz@google.com>
parents: 45055
diff changeset
  1131
  config error at .hglfs:3: bad file ... no commit
9dc1351d0b5f errors: raise ConfigError on failure to parse config file
Martin von Zweigbergk <martinvonz@google.com>
parents: 45055
diff changeset
  1132
  [30]
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1133
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1134
  $ cat > .hglfs << EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1135
  > [track]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1136
  > **.test = size(">5B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1137
  > ** = nonexistent()
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1138
  > EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1139
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1140
  $ hg ci -Aqm 'should fail'
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1141
  abort: parse error in .hglfs: unknown identifier: nonexistent
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1142
  [255]
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1143
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1144
'**' works out to mean all files.
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1145
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1146
  $ cat > .hglfs << EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1147
  > [track]
35799
b91bca85ba73 lfs: don't automatically exclude '.hg*' files from external tracking
Matt Harbison <matt_harbison@yahoo.com>
parents: 35798
diff changeset
  1148
  > path:.hglfs = none()
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1149
  > **.test = size(">5B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1150
  > **.exclude = none()
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1151
  > ** = size(">10B")
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1152
  > EOF
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1153
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1154
The LFS policy takes effect without tracking the .hglfs file
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1155
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1156
  $ echo 'largefile' > lfs.test
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1157
  $ echo '012345678901234567890' > nolfs.exclude
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1158
  $ echo '01234567890123456' > lfs.catchall
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1159
  $ hg add *
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1160
  $ hg ci -qm 'before add .hglfs'
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
  1161
  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1162
  2: lfs.catchall: d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1163
  lfs.test: 5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1164
  
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1165
The .hglfs file works when tracked
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1166
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1167
  $ echo 'largefile2' > lfs.test
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1168
  $ echo '012345678901234567890a' > nolfs.exclude
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1169
  $ echo '01234567890123456a' > lfs.catchall
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1170
  $ hg ci -Aqm 'after adding .hglfs'
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
  1171
  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1172
  3: lfs.catchall: 31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1173
  lfs.test: 8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1174
  
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1175
The LFS policy stops when the .hglfs is gone
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1176
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1177
  $ mv .hglfs .hglfs_
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1178
  $ echo 'largefile3' > lfs.test
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1179
  $ echo '012345678901234567890abc' > nolfs.exclude
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1180
  $ echo '01234567890123456abc' > lfs.catchall
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1181
  $ hg ci -qm 'file test' -X .hglfs
35798
97bdbcb43ebf lfs: rename {oid} to {lfsoid}
Matt Harbison <matt_harbison@yahoo.com>
parents: 35797
diff changeset
  1182
  $ hg log -r . -T '{rev}: {lfs_files % "{file}: {lfsoid}\n"}\n'
35807
4425790f2373 lfs: don't require the .hglfs file to be tracked to control the policy
Matt Harbison <matt_harbison@yahoo.com>
parents: 35800
diff changeset
  1183
  4: 
35665
1ad1e59b405e lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com>
parents: 35663
diff changeset
  1184
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1185
  $ mv .hglfs_ .hglfs
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1186
  $ echo '012345678901234567890abc' > lfs.test
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1187
  $ hg ci -m 'back to lfs'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1188
  $ hg rm lfs.test
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1189
  $ hg ci -qm 'remove lfs'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1190
35999
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1191
{lfs_files} will list deleted files too
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1192
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1193
  $ hg log -T "{lfs_files % '{rev} {file}: {lfspointer.oid}\n'}"
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1194
  6 lfs.test: 
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1195
  5 lfs.test: sha256:43f8f41171b6f62a6b61ba4ce98a8a6c1649240a47ebafd43120aa215ac9e7f6
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1196
  3 lfs.catchall: sha256:31f43b9c62b540126b0ad5884dc013d21a61c9329b77de1fceeae2fc58511573
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1197
  3 lfs.test: sha256:8acd23467967bc7b8cc5a280056589b0ba0b17ff21dbd88a7b6474d6290378a6
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1198
  2 lfs.catchall: sha256:d4ec46c2869ba22eceb42a729377432052d9dd75d82fc40390ebaadecee87ee9
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1199
  2 lfs.test: sha256:5489e6ced8c36a7b267292bde9fd5242a5f80a7482e8f23fa0477393dfaa4d6c
8c7d5e90e6bd lfs: teach '{lfs_files}' to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35990
diff changeset
  1200
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1201
  $ hg log -r 'file("set:lfs()")' -T '{rev} {join(lfs_files, ", ")}\n'
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1202
  2 lfs.catchall, lfs.test
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1203
  3 lfs.catchall, lfs.test
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1204
  5 lfs.test
36000
91aac8e6604d lfs: teach the 'lfs()' fileset to handle removed files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35999
diff changeset
  1205
  6 lfs.test
35990
eefb5d603482 lfs: add a fileset for detecting lfs files
Matt Harbison <matt_harbison@yahoo.com>
parents: 35922
diff changeset
  1206
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1207
  $ cd ..
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1208
35504
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35502
diff changeset
  1209
Unbundling adds a requirement to a non-lfs repo, if necessary.
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1210
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1211
  $ 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
  1212
  $ 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
  1213
  $ hg init unbundle
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1214
  $ hg pull -R unbundle -q nolfs.hg
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1215
  $ hg debugrequires -R unbundle | grep lfs
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1216
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1217
  $ hg pull -R unbundle -q lfs.hg
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1218
  $ hg debugrequires -R unbundle | grep lfs
35504
6bb940de4c4c lfs: add the 'lfs' requirement in the changegroup transaction introducing lfs
Matt Harbison <matt_harbison@yahoo.com>
parents: 35502
diff changeset
  1219
  lfs
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1220
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1221
  $ hg init no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1222
  $ cat >> no_lfs/.hg/hgrc <<EOF
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1223
  > [experimental]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1224
  > changegroup3 = True
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1225
  > [extensions]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1226
  > lfs=!
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1227
  > EOF
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1228
  $ cp -R no_lfs no_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1229
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1230
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
  1231
with lfs disabled, fails.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1232
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1233
  $ 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
  1234
  pushing to no_lfs
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1235
  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
  1236
  [255]
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1237
  $ hg debugrequires -R no_lfs/ | grep lfs
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1238
  [1]
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1239
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1240
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
  1241
with lfs disabled, fails.
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1242
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1243
  $ 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
  1244
  pulling from convert_lfs2
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1245
  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
  1246
  [255]
48657
68b7faeb6ef3 tests: use debugrequires instead of grepping the file directly
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48360
diff changeset
  1247
  $ hg debugrequires -R no_lfs2/ | grep lfs
35502
67611e06ff08 test-lfs: add tests covering local exchanges
Matt Harbison <matt_harbison@yahoo.com>
parents: 35477
diff changeset
  1248
  [1]