Rev 3392: (abentley) Fix fetch from non-rich-root to rich-root in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Wed Apr 30 07:55:00 BST 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3392
revision-id:pqm at pqm.ubuntu.com-20080430065440-1l8693padc4f7uho
parent: pqm at pqm.ubuntu.com-20080430034827-95gmd3iu0j7vrr5p
parent: aaron at aaronbentley.com-20080430045116-ge00vr9d5j9f2ca1
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Wed 2008-04-30 07:54:40 +0100
message:
  (abentley) Fix fetch from non-rich-root to rich-root
added:
  bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/bundle/bundle_data.py   read_changeset.py-20050619171944-c0d95aa685537640
  bzrlib/bundle/serializer/v4.py v10.py-20070611062757-5ggj7k18s9dej0fr-1
  bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
  bzrlib/tests/interrepository_implementations/__init__.py __init__.py-20060220054744-baf49a1f88f17b1a
  bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
  bzrlib/tests/test_bundle.py    test.py-20050630184834-092aa401ab9f039c
  bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
    ------------------------------------------------------------
    revno: 3380.1.16
    revision-id:aaron at aaronbentley.com-20080430045116-ge00vr9d5j9f2ca1
    parent: aaron at aaronbentley.com-20080429162218-r6v6ergxxc6eesuo
    parent: aaron at aaronbentley.com-20080430045058-qcw3x9bknel53vkq
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Wed 2008-04-30 00:51:16 -0400
    message:
      Merge with cleanup
    modified:
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
        ------------------------------------------------------------
        revno: 3380.1.5.1.5
        revision-id:aaron at aaronbentley.com-20080430045058-qcw3x9bknel53vkq
        parent: aaron at aaronbentley.com-20080429162204-vifcvgyeywb1vh87
        parent: aaron at aaronbentley.com-20080430045030-vsw4qvpdkh5vp9yd
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: cleanup
        timestamp: Wed 2008-04-30 00:50:58 -0400
        message:
          Merge with make-it-work
        modified:
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
        ------------------------------------------------------------
        revno: 3380.1.3.1.7
        revision-id:aaron at aaronbentley.com-20080430045030-vsw4qvpdkh5vp9yd
        parent: aaron at aaronbentley.com-20080429161740-qw8cjfqqhgm2sl8y
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Wed 2008-04-30 00:50:30 -0400
        message:
          Update docs
        modified:
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
    ------------------------------------------------------------
    revno: 3380.1.15
    revision-id:aaron at aaronbentley.com-20080429162218-r6v6ergxxc6eesuo
    parent: aaron at aaronbentley.com-20080429152014-wdr2jy5xw1nk1yov
    parent: aaron at aaronbentley.com-20080429162204-vifcvgyeywb1vh87
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Tue 2008-04-29 12:22:18 -0400
    message:
      Merge cleanup
    modified:
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
        ------------------------------------------------------------
        revno: 3380.1.5.1.4
        revision-id:aaron at aaronbentley.com-20080429162204-vifcvgyeywb1vh87
        parent: aaron at aaronbentley.com-20080429151942-s48lj1yj8q0xxkak
        parent: aaron at aaronbentley.com-20080429161740-qw8cjfqqhgm2sl8y
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: cleanup
        timestamp: Tue 2008-04-29 12:22:04 -0400
        message:
          Merge make-it-work
        modified:
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
        ------------------------------------------------------------
        revno: 3380.1.3.1.6
        revision-id:aaron at aaronbentley.com-20080429161740-qw8cjfqqhgm2sl8y
        parent: aaron at aaronbentley.com-20080429151403-r1ak2ew0mdp30o53
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Tue 2008-04-29 12:17:40 -0400
        message:
          Remove versionedfile
        modified:
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
    ------------------------------------------------------------
    revno: 3380.1.14
    revision-id:aaron at aaronbentley.com-20080429152014-wdr2jy5xw1nk1yov
    parent: aaron at aaronbentley.com-20080428040005-pe3ro8w6qwrsvs2u
    parent: aaron at aaronbentley.com-20080429151942-s48lj1yj8q0xxkak
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Tue 2008-04-29 11:20:14 -0400
    message:
      merge with cleanup
    modified:
      Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzr                            bzr.py-20050313053754-5485f144c7006fa6
      bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
      bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
      bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/revisiontree.py         revisiontree.py-20060724012533-bg8xyryhxd0o0i0h-1
      bzrlib/store/revision/knit.py  knit.py-20060303020652-de5fa299e941a3c7
      bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
      bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
      bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
      bzrlib/tests/test_store.py     teststore.py-20050826022702-f6caadb647395769
      bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
      bzrlib/tests/tree_implementations/test_inv.py test_inv.py-20070312023226-0cdvk5uwhutis9vg-1
      bzrlib/tests/tree_implementations/test_test_trees.py test_tree_trees.py-20060720091921-3nwi5h21lf06vf5p-1
      bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
      bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
      bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
      bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
      doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
        ------------------------------------------------------------
        revno: 3380.1.5.1.3
        revision-id:aaron at aaronbentley.com-20080429151942-s48lj1yj8q0xxkak
        parent: aaron at aaronbentley.com-20080428034107-rmyfgikhoyk3s5z7
        parent: aaron at aaronbentley.com-20080429151403-r1ak2ew0mdp30o53
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: cleanup
        timestamp: Tue 2008-04-29 11:19:42 -0400
        message:
          Merge with bzr.dev
        modified:
          Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzr                            bzr.py-20050313053754-5485f144c7006fa6
          bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
          bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
          bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
          bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
          bzrlib/revisiontree.py         revisiontree.py-20060724012533-bg8xyryhxd0o0i0h-1
          bzrlib/store/revision/knit.py  knit.py-20060303020652-de5fa299e941a3c7
          bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
          bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
          bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
          bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
          bzrlib/tests/test_store.py     teststore.py-20050826022702-f6caadb647395769
          bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
          bzrlib/tests/tree_implementations/test_inv.py test_inv.py-20070312023226-0cdvk5uwhutis9vg-1
          bzrlib/tests/tree_implementations/test_test_trees.py test_tree_trees.py-20060720091921-3nwi5h21lf06vf5p-1
          bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
          bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
          bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
          bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
          doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
        ------------------------------------------------------------
        revno: 3380.1.3.1.5
        revision-id:aaron at aaronbentley.com-20080429151403-r1ak2ew0mdp30o53
        parent: aaron at aaronbentley.com-20080429150723-eqd5di6s1cr14q3g
        parent: pqm at pqm.ubuntu.com-20080429014232-4b86ax5pwynnf11i
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Tue 2008-04-29 11:14:03 -0400
        message:
          Merge bzr.dev
        modified:
          Makefile                       Makefile-20050805140406-d96e3498bb61c5bb
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzr                            bzr.py-20050313053754-5485f144c7006fa6
          bzrlib/__init__.py             __init__.py-20050309040759-33e65acf91bbcd5d
          bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
          bzrlib/knit.py                 knit.py-20051212171256-f056ac8f0fbe1bd9
          bzrlib/log.py                  log.py-20050505065812-c40ce11702fe5fb1
          bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
          bzrlib/revisiontree.py         revisiontree.py-20060724012533-bg8xyryhxd0o0i0h-1
          bzrlib/store/revision/knit.py  knit.py-20060303020652-de5fa299e941a3c7
          bzrlib/tests/blackbox/test_version.py test_version.py-20070312060045-ol7th9z035r3im3d-1
          bzrlib/tests/test_knit.py      test_knit.py-20051212171302-95d4c00dd5f11f2b
          bzrlib/tests/test_selftest.py  test_selftest.py-20051202044319-c110a115d8c0456a
          bzrlib/tests/test_store.py     teststore.py-20050826022702-f6caadb647395769
          bzrlib/tests/tree_implementations/__init__.py __init__.py-20060717075546-420s7b0bj9hzeowi-2
          bzrlib/tests/tree_implementations/test_inv.py test_inv.py-20070312023226-0cdvk5uwhutis9vg-1
          bzrlib/tests/tree_implementations/test_test_trees.py test_tree_trees.py-20060720091921-3nwi5h21lf06vf5p-1
          bzrlib/transform.py            transform.py-20060105172343-dd99e54394d91687
          bzrlib/tree.py                 tree.py-20050309040759-9d5f2496be663e77
          bzrlib/workingtree.py          workingtree.py-20050511021032-29b6ec0a681e02e3
          bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
          doc/developers/HACKING.txt     HACKING-20050805200004-2a5dc975d870f78c
        ------------------------------------------------------------
        revno: 3380.1.3.1.4
        revision-id:aaron at aaronbentley.com-20080429150723-eqd5di6s1cr14q3g
        parent: aaron at aaronbentley.com-20080428034047-x3cuymv3k0qjjkrp
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Tue 2008-04-29 11:07:23 -0400
        message:
          Updates from review
        modified:
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
    ------------------------------------------------------------
    revno: 3380.1.13
    revision-id:aaron at aaronbentley.com-20080428040005-pe3ro8w6qwrsvs2u
    parent: aaron at aaronbentley.com-20080428035556-w8hv8dv6vo5k3j6i
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Mon 2008-04-28 00:00:05 -0400
    message:
      Fix normal revision installation
    modified:
      bzrlib/bundle/serializer/v4.py v10.py-20070611062757-5ggj7k18s9dej0fr-1
    ------------------------------------------------------------
    revno: 3380.1.12
    revision-id:aaron at aaronbentley.com-20080428035556-w8hv8dv6vo5k3j6i
    parent: aaron at aaronbentley.com-20080428034134-wzqqujphjdpo9by1
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 23:55:56 -0400
    message:
      fix test
    modified:
      bzrlib/tests/test_bundle.py    test.py-20050630184834-092aa401ab9f039c
    ------------------------------------------------------------
    revno: 3380.1.11
    revision-id:aaron at aaronbentley.com-20080428034134-wzqqujphjdpo9by1
    parent: aaron at aaronbentley.com-20080428015309-nwp7iwqk16ie8sh5
    parent: aaron at aaronbentley.com-20080428034107-rmyfgikhoyk3s5z7
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 23:41:34 -0400
    message:
      Merge with cleanup
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/tests/repository_implementations/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
      bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
        ------------------------------------------------------------
        revno: 3380.1.5.1.2
        revision-id:aaron at aaronbentley.com-20080428034107-rmyfgikhoyk3s5z7
        parent: aaron at aaronbentley.com-20080428014746-tz4zai2cqhyoc0u2
        parent: aaron at aaronbentley.com-20080428034047-x3cuymv3k0qjjkrp
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: cleanup
        timestamp: Sun 2008-04-27 23:41:07 -0400
        message:
          Merge with make-it-work
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
          bzrlib/tests/repository_implementations/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
          bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
        ------------------------------------------------------------
        revno: 3380.1.3.1.3
        revision-id:aaron at aaronbentley.com-20080428034047-x3cuymv3k0qjjkrp
        parent: aaron at aaronbentley.com-20080428014729-h1uc6156xx9te4m4
        parent: pqm at pqm.ubuntu.com-20080428032913-4fgik9du2kpxl8sf
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Sun 2008-04-27 23:40:47 -0400
        message:
          Merge with bzr.dev
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
          bzrlib/tests/repository_implementations/test_fetch.py test_fetch.py-20070814052151-5cxha9slx4c93uog-1
          bzrlib/tests/test_reconfigure.py test_reconfigure.py-20070908040425-6ykgo7escxhyrg9p-2
    ------------------------------------------------------------
    revno: 3380.1.10
    revision-id:aaron at aaronbentley.com-20080428015309-nwp7iwqk16ie8sh5
    parent: aaron at aaronbentley.com-20080428015242-5yrgim0qs6cvqf1l
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 21:53:09 -0400
    message:
      Update NEWS
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
    ------------------------------------------------------------
    revno: 3380.1.9
    revision-id:aaron at aaronbentley.com-20080428015242-5yrgim0qs6cvqf1l
    parent: aaron at aaronbentley.com-20080428004940-hipydum9ucwsc0qu
    parent: aaron at aaronbentley.com-20080428014746-tz4zai2cqhyoc0u2
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 21:52:42 -0400
    message:
      Merge with cleanups
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
        ------------------------------------------------------------
        revno: 3380.1.5.1.1
        revision-id:aaron at aaronbentley.com-20080428014746-tz4zai2cqhyoc0u2
        parent: aaron at aaronbentley.com-20080427223542-251if36avw98tauo
        parent: aaron at aaronbentley.com-20080428014729-h1uc6156xx9te4m4
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: cleanup
        timestamp: Sun 2008-04-27 21:47:46 -0400
        message:
          Merge make-it-work
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
        ------------------------------------------------------------
        revno: 3380.1.3.1.2
        revision-id:aaron at aaronbentley.com-20080428014729-h1uc6156xx9te4m4
        parent: aaron at aaronbentley.com-20080427222948-hd5kcqx6157xq5on
        parent: pqm at pqm.ubuntu.com-20080428012318-g5zq9wl2flua3r2s
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Sun 2008-04-27 21:47:29 -0400
        message:
          Merge bzr.dev
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/transport/ftp.py        ftp.py-20051116161804-58dc9506548c2a53
    ------------------------------------------------------------
    revno: 3380.1.8
    revision-id:aaron at aaronbentley.com-20080428004940-hipydum9ucwsc0qu
    parent: aaron at aaronbentley.com-20080428004710-gd8t8y6rgq38wy38
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 20:49:40 -0400
    message:
      Test that the stored inventory hash is correct when bundles are used
    modified:
      bzrlib/bundle/serializer/v4.py v10.py-20070611062757-5ggj7k18s9dej0fr-1
      bzrlib/tests/test_bundle.py    test.py-20050630184834-092aa401ab9f039c
    ------------------------------------------------------------
    revno: 3380.1.7
    revision-id:aaron at aaronbentley.com-20080428004710-gd8t8y6rgq38wy38
    parent: aaron at aaronbentley.com-20080427234745-vng2ghxfnjqmmksc
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 20:47:10 -0400
    message:
      Remove bogus bundle validation
    modified:
      bzrlib/bundle/bundle_data.py   read_changeset.py-20050619171944-c0d95aa685537640
    ------------------------------------------------------------
    revno: 3380.1.6
    revision-id:aaron at aaronbentley.com-20080427234745-vng2ghxfnjqmmksc
    parent: aaron at aaronbentley.com-20080427223542-251if36avw98tauo
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: make-it-right
    timestamp: Sun 2008-04-27 19:47:45 -0400
    message:
      Ensure fetching munges sha1s
    modified:
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
    ------------------------------------------------------------
    revno: 3380.1.5
    revision-id:aaron at aaronbentley.com-20080427223542-251if36avw98tauo
    parent: aaron at aaronbentley.com-20080425213659-efe3yt7x3sxaplkn
    parent: aaron at aaronbentley.com-20080427222948-hd5kcqx6157xq5on
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: cleanup
    timestamp: Sun 2008-04-27 18:35:42 -0400
    message:
      Merge with make-it-work
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/diff.py                 diff.py-20050309040759-26944fbbf2ebbf36
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/revisionspec.py         revisionspec.py-20050907152633-17567659fd5c0ddb
      bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
      bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
      bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
        ------------------------------------------------------------
        revno: 3380.1.3.1.1
        revision-id:aaron at aaronbentley.com-20080427222948-hd5kcqx6157xq5on
        parent: aaron at aaronbentley.com-20080425131627-i2kuaqo6fu74hj8e
        parent: pqm at pqm.ubuntu.com-20080427070204-4t5flfqnnmr6bmiw
        committer: Aaron Bentley <aaron at aaronbentley.com>
        branch nick: make-it-work
        timestamp: Sun 2008-04-27 18:29:48 -0400
        message:
          Merge with bzr.dev
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/diff.py                 diff.py-20050309040759-26944fbbf2ebbf36
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
          bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
          bzrlib/revisionspec.py         revisionspec.py-20050907152633-17567659fd5c0ddb
          bzrlib/smart/repository.py     repository.py-20061128022038-vr5wy5bubyb8xttk-1
          bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
          bzrlib/tests/repository_implementations/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
          bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
    ------------------------------------------------------------
    revno: 3380.1.4
    revision-id:aaron at aaronbentley.com-20080425213659-efe3yt7x3sxaplkn
    parent: aaron at aaronbentley.com-20080425131627-i2kuaqo6fu74hj8e
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: cleanup
    timestamp: Fri 2008-04-25 17:36:59 -0400
    message:
      Split interrepository fetch tests into their own file
    added:
      bzrlib/tests/interrepository_implementations/test_fetch.py test_fetch.py-20080425213627-j60cjh782ufm83ry-1
    modified:
      bzrlib/tests/interrepository_implementations/__init__.py __init__.py-20060220054744-baf49a1f88f17b1a
      bzrlib/tests/interrepository_implementations/test_interrepository.py test_interrepository.py-20060220061411-1ec13fa99e5e3eee
    ------------------------------------------------------------
    revno: 3380.1.3
    revision-id:aaron at aaronbentley.com-20080425131627-i2kuaqo6fu74hj8e
    parent: aaron at aaronbentley.com-20080425042959-smj8skzokwe8kbxt
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: fetch1to2
    timestamp: Fri 2008-04-25 09:16:27 -0400
    message:
      Fix model-change fetching with ghosts and when fetch is resumed
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
    ------------------------------------------------------------
    revno: 3380.1.2
    revision-id:aaron at aaronbentley.com-20080425042959-smj8skzokwe8kbxt
    parent: aaron at aaronbentley.com-20080425022747-4euksn81ffolid60
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: fetch1to2
    timestamp: Fri 2008-04-25 00:29:59 -0400
    message:
      Improve handling ghosts and changing root_ids
    modified:
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
    ------------------------------------------------------------
    revno: 3380.1.1
    revision-id:aaron at aaronbentley.com-20080425022747-4euksn81ffolid60
    parent: pqm at pqm.ubuntu.com-20080424185721-ukk0dncnc4xpqk5o
    committer: Aaron Bentley <aaron at aaronbentley.com>
    branch nick: fetch1to2
    timestamp: Thu 2008-04-24 22:27:47 -0400
    message:
      Fix inventory insertion to work in topological order
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
=== added file 'bzrlib/tests/interrepository_implementations/test_fetch.py'
--- a/bzrlib/tests/interrepository_implementations/test_fetch.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/interrepository_implementations/test_fetch.py	2008-04-27 23:47:45 +0000
@@ -0,0 +1,216 @@
+# Copyright (C) 2005, 2006, 2008 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+import sys
+
+import bzrlib
+from bzrlib import (
+    errors,
+    repository,
+    osutils,
+    )
+from bzrlib.errors import (
+    NoSuchRevision,
+    )
+from bzrlib.revision import (
+    NULL_REVISION,
+    Revision,
+    )
+from bzrlib.tests import (
+    TestNotApplicable,
+    )
+from bzrlib.tests.interrepository_implementations import (
+    TestCaseWithInterRepository,
+    )
+
+
+class TestInterRepository(TestCaseWithInterRepository):
+
+    def test_fetch(self):
+        tree_a = self.make_branch_and_tree('a')
+        self.build_tree(['a/foo'])
+        tree_a.add('foo', 'file1')
+        tree_a.commit('rev1', rev_id='rev1')
+        def check_push_rev1(repo):
+            # ensure the revision is missing.
+            self.assertRaises(NoSuchRevision, repo.get_revision, 'rev1')
+            # fetch with a limit of NULL_REVISION and an explicit progress bar.
+            repo.fetch(tree_a.branch.repository,
+                       revision_id=NULL_REVISION,
+                       pb=bzrlib.progress.DummyProgress())
+            # nothing should have been pushed
+            self.assertFalse(repo.has_revision('rev1'))
+            # fetch with a default limit (grab everything)
+            repo.fetch(tree_a.branch.repository)
+            # check that b now has all the data from a's first commit.
+            rev = repo.get_revision('rev1')
+            tree = repo.revision_tree('rev1')
+            tree.lock_read()
+            self.addCleanup(tree.unlock)
+            tree.get_file_text('file1')
+            for file_id in tree:
+                if tree.inventory[file_id].kind == "file":
+                    tree.get_file(file_id).read()
+
+        # makes a target version repo 
+        repo_b = self.make_to_repository('b')
+        check_push_rev1(repo_b)
+
+    def test_fetch_missing_basis_text(self):
+        """If fetching a delta, we should die if a basis is not present."""
+        tree = self.make_branch_and_tree('tree')
+        self.build_tree(['tree/a'])
+        tree.add(['a'], ['a-id'])
+        tree.commit('one', rev_id='rev-one')
+        self.build_tree_contents([('tree/a', 'new contents\n')])
+        tree.commit('two', rev_id='rev-two')
+
+        to_repo = self.make_to_repository('to_repo')
+        # We build a broken revision so that we can test the fetch code dies
+        # properly. So copy the inventory and revision, but not the text.
+        to_repo.lock_write()
+        try:
+            to_repo.start_write_group()
+            inv = tree.branch.repository.get_inventory('rev-one')
+            to_repo.add_inventory('rev-one', inv, [])
+            rev = tree.branch.repository.get_revision('rev-one')
+            to_repo.add_revision('rev-one', rev, inv=inv)
+            to_repo.commit_write_group()
+        finally:
+            to_repo.unlock()
+
+        # Implementations can either copy the missing basis text, or raise an
+        # exception
+        try:
+            to_repo.fetch(tree.branch.repository, 'rev-two')
+        except errors.RevisionNotPresent, e:
+            # If an exception is raised, the revision should not be in the
+            # target.
+            self.assertRaises(
+                (errors.NoSuchRevision, errors.RevisionNotPresent),
+                 to_repo.revision_tree, 'rev-two')
+        else:
+            # If not exception is raised, then the basis text should be
+            # available.
+            to_repo.lock_read()
+            try:
+                rt = to_repo.revision_tree('rev-one')
+                self.assertEqual('contents of tree/a\n',
+                                 rt.get_file_text('a-id'))
+            finally:
+                to_repo.unlock()
+
+    def test_fetch_missing_revision_same_location_fails(self):
+        repo_a = self.make_repository('.')
+        repo_b = repository.Repository.open('.')
+        try:
+            self.assertRaises(errors.NoSuchRevision, repo_b.fetch, repo_a,
+                              revision_id='XXX')
+        except errors.LockError, e:
+            check_old_format_lock_error(self.repository_format)
+
+    def test_fetch_same_location_trivial_works(self):
+        repo_a = self.make_repository('.')
+        repo_b = repository.Repository.open('.')
+        try:
+            repo_a.fetch(repo_b)
+        except errors.LockError, e:
+            check_old_format_lock_error(self.repository_format)
+
+    def test_fetch_missing_text_other_location_fails(self):
+        source_tree = self.make_branch_and_tree('source')
+        source = source_tree.branch.repository
+        target = self.make_to_repository('target')
+    
+        # start by adding a file so the data knit for the file exists in
+        # repositories that have specific files for each fileid.
+        self.build_tree(['source/id'])
+        source_tree.add(['id'], ['id'])
+        source_tree.commit('a', rev_id='a')
+        # now we manually insert a revision with an inventory referencing
+        # 'id' at revision 'b', but we do not insert revision b.
+        # this should ensure that the new versions of files are being checked
+        # for during pull operations
+        inv = source.get_inventory('a')
+        source.lock_write()
+        self.addCleanup(source.unlock)
+        source.start_write_group()
+        inv['id'].revision = 'b'
+        inv.revision_id = 'b'
+        sha1 = source.add_inventory('b', inv, ['a'])
+        rev = Revision(timestamp=0,
+                       timezone=None,
+                       committer="Foo Bar <foo at example.com>",
+                       message="Message",
+                       inventory_sha1=sha1,
+                       revision_id='b')
+        rev.parent_ids = ['a']
+        source.add_revision('b', rev)
+        source.commit_write_group()
+        self.assertRaises(errors.RevisionNotPresent, target.fetch, source)
+        self.assertFalse(target.has_revision('b'))
+
+    def test_fetch_funky_file_id(self):
+        from_tree = self.make_branch_and_tree('tree')
+        if sys.platform == 'win32':
+            from_repo = from_tree.branch.repository
+            check_repo_format_for_funky_id_on_win32(from_repo)
+        self.build_tree(['tree/filename'])
+        from_tree.add('filename', 'funky-chars<>%&;"\'')
+        from_tree.commit('commit filename')
+        to_repo = self.make_to_repository('to')
+        to_repo.fetch(from_tree.branch.repository,
+                      from_tree.get_parent_ids()[0])
+
+    def test_fetch_revision_hash(self):
+        """Ensure that inventory hashes are updated by fetch"""
+        from_tree = self.make_branch_and_tree('tree')
+        from_tree.commit('foo', rev_id='foo-id')
+        to_repo = self.make_to_repository('to')
+        to_repo.fetch(from_tree.branch.repository)
+        recorded_inv_sha1 = to_repo.get_inventory_sha1('foo-id')
+        xml = to_repo.get_inventory_xml('foo-id')
+        computed_inv_sha1 = osutils.sha_string(xml)
+        self.assertEqual(computed_inv_sha1, recorded_inv_sha1)
+
+
+class TestFetchDependentData(TestCaseWithInterRepository):
+
+    def test_reference(self):
+        from_tree = self.make_branch_and_tree('tree')
+        to_repo = self.make_to_repository('to')
+        if (not from_tree.supports_tree_reference() or
+            not from_tree.branch.repository._format.supports_tree_reference or
+            not to_repo._format.supports_tree_reference):
+            raise TestNotApplicable("Need subtree support.")
+        subtree = self.make_branch_and_tree('tree/subtree')
+        subtree.commit('subrev 1')
+        from_tree.add_reference(subtree)
+        tree_rev = from_tree.commit('foo')
+        # now from_tree has a last-modified of subtree of the rev id of the
+        # commit for foo, and a reference revision of the rev id of the commit
+        # for subrev 1
+        to_repo.fetch(from_tree.branch.repository, tree_rev)
+        # to_repo should have a file_graph for from_tree.path2id('subtree') and
+        # revid tree_rev.
+        to_repo.lock_read()
+        try:
+            file_vf = to_repo.weave_store.get_weave(
+                from_tree.path2id('subtree'), to_repo.get_transaction())
+            self.assertEqual([tree_rev], file_vf.get_ancestry([tree_rev]))
+        finally:
+            to_repo.unlock()

=== modified file 'NEWS'
--- a/NEWS	2008-04-29 17:53:50 +0000
+++ b/NEWS	2008-04-30 06:54:40 +0000
@@ -35,6 +35,15 @@
     * ``bzr commit`` now works with Microsoft's FTP service.
       (Andreas Deininger)
 
+    * Conversion from non-rich-root to rich-root(-pack) updates inventory
+      sha1s, even when bundles are used.  (Aaron Bentley, #181391)
+
+    * Conversion from non-rich-root to rich-root(-pack) works correctly even
+      though search keys are not topologically sorted.  (Aaron Bentley)
+
+    * Conversion from non-rich-root to rich-root(-pack) works even when a
+      parent revision has a different root id.  (Aaron Bentley, #177874)
+
     * Fetching all revisions from a repository does not cause pack collisions.
       (Robert Collins, Aaron Bentley, #212908)
 

=== modified file 'bzrlib/bundle/bundle_data.py'
--- a/bzrlib/bundle/bundle_data.py	2007-09-25 08:14:12 +0000
+++ b/bzrlib/bundle/bundle_data.py	2008-04-28 00:47:10 +0000
@@ -260,21 +260,6 @@
             elif revision_id not in checked:
                 missing[revision_id] = sha1
 
-        for inv_id, sha1 in inv_to_sha.iteritems():
-            if repository.has_revision(inv_id):
-                # Note: branch.get_inventory_sha1() just returns the value that
-                # is stored in the revision text, and that value may be out
-                # of date. This is bogus, because that means we aren't
-                # validating the actual text, just that we wrote and read the
-                # string. But for now, what the hell.
-                local_sha1 = repository.get_inventory_sha1(inv_id)
-                if sha1 != local_sha1:
-                    raise BzrError('sha1 mismatch. For inventory id {%s}' 
-                                   'local: %s, bundle: %s' % 
-                                   (inv_id, local_sha1, sha1))
-                else:
-                    count += 1
-
         if len(missing) > 0:
             # I don't know if this is an error yet
             warning('Not all revision hashes could be validated.'

=== modified file 'bzrlib/bundle/serializer/v4.py'
--- a/bzrlib/bundle/serializer/v4.py	2008-03-19 04:39:04 +0000
+++ b/bzrlib/bundle/serializer/v4.py	2008-04-28 04:00:05 +0000
@@ -588,7 +588,11 @@
     def _install_revision(self, revision_id, metadata, text):
         if self._repository.has_revision(revision_id):
             return
-        self._repository._add_revision_text(revision_id, text)
+        if self._info['serializer'] == self._repository._serializer.format_num:
+            self._repository._add_revision_text(revision_id, text)
+        else:
+            revision = self._source_serializer.read_revision_from_string(text)
+            self._repository.add_revision(revision.revision_id, revision)
 
     def _install_signature(self, revision_id, metadata, text):
         transaction = self._repository.get_transaction()

=== modified file 'bzrlib/fetch.py'
--- a/bzrlib/fetch.py	2008-04-28 03:52:09 +0000
+++ b/bzrlib/fetch.py	2008-04-30 04:51:16 +0000
@@ -158,7 +158,10 @@
         pb = bzrlib.ui.ui_factory.nested_progress_bar()
         try:
             revs = search.get_keys()
-            data_to_fetch = self.from_repository.item_keys_introduced_by(revs, pb)
+            graph = self.from_repository.get_graph()
+            revs = list(graph.iter_topo_order(revs))
+            data_to_fetch = self.from_repository.item_keys_introduced_by(revs,
+                                                                         pb)
             for knit_kind, file_id, revisions in data_to_fetch:
                 if knit_kind != phase:
                     phase = knit_kind
@@ -268,8 +271,7 @@
             except errors.NoSuchRevision:
                 # not signed.
                 pass
-            to_store.add_revision(self.from_repository.get_revision(rev),
-                                  to_txn)
+            self._copy_revision(rev, to_txn)
             count += 1
         # fixup inventory if needed: 
         # this is expensive because we have no inverse index to current ghosts.
@@ -277,7 +279,11 @@
         # so we just-do-it.
         # FIXME: repository should inform if this is needed.
         self.to_repository.reconcile()
-    
+
+    def _copy_revision(self, rev, to_txn):
+        to_store = self.to_repository._revision_store
+        to_store.add_revision(self.from_repository.get_revision(rev), to_txn)
+
 
 class KnitRepoFetcher(RepoFetcher):
     """This is a knit format repository specific fetcher.
@@ -296,11 +302,15 @@
         from_sf = self.from_repository._revision_store.get_signature_file(
             from_transaction)
         to_sf.join(from_sf, version_ids=revs, ignore_missing=True)
+        self._fetch_just_revision_texts(revs, from_transaction, to_transaction)
+
+    def _fetch_just_revision_texts(self, version_ids, from_transaction,
+                                   to_transaction):
         to_rf = self.to_repository._revision_store.get_revision_file(
             to_transaction)
         from_rf = self.from_repository._revision_store.get_revision_file(
             from_transaction)
-        to_rf.join(from_rf, version_ids=revs)
+        to_rf.join(from_rf, version_ids=version_ids)
 
 
 class Inter1and2Helper(object):
@@ -337,27 +347,54 @@
                 yield tree
             revs = revs[100:]
 
+    def _find_root_ids(self, revs, parent_map, graph):
+        revision_root = {}
+        planned_versions = {}
+        for tree in self.iter_rev_trees(revs):
+            revision_id = tree.inventory.root.revision
+            root_id = tree.get_root_id()
+            planned_versions.setdefault(root_id, []).append(revision_id)
+            revision_root[revision_id] = root_id
+        # Find out which parents we don't already know root ids for
+        parents = set()
+        for revision_parents in parent_map.itervalues():
+            parents.update(revision_parents)
+        parents.difference_update(revision_root.keys() + [NULL_REVISION])
+        # Limit to revisions present in the versionedfile
+        parents = graph.get_parent_map(parents).keys()
+        for tree in self.iter_rev_trees(parents):
+            root_id = tree.get_root_id()
+            revision_root[tree.get_revision_id()] = root_id
+        return revision_root, planned_versions
+
     def generate_root_texts(self, revs):
         """Generate VersionedFiles for all root ids.
-        
+
         :param revs: the revisions to include
         """
-        inventory_weave = self.source.get_inventory_weave()
-        parent_texts = {}
-        versionedfile = {}
         to_store = self.target.weave_store
-        parent_map = self.source.get_graph().get_parent_map(revs)
-        for tree in self.iter_rev_trees(revs):
-            revision_id = tree.inventory.root.revision
-            root_id = tree.get_root_id()
-            parents = parent_map[revision_id]
-            if parents[0] == NULL_REVISION:
-                parents = ()
-            if root_id not in versionedfile:
-                versionedfile[root_id] = to_store.get_weave_or_empty(root_id,
-                    self.target.get_transaction())
-            _, _, parent_texts[root_id] = versionedfile[root_id].add_lines(
-                revision_id, parents, [], parent_texts)
+        graph = self.source.get_graph()
+        parent_map = graph.get_parent_map(revs)
+        revision_root, planned_versions = self._find_root_ids(
+            revs, parent_map, graph)
+        for root_id, versions in planned_versions.iteritems():
+            versionedfile = to_store.get_weave_or_empty(root_id,
+                self.target.get_transaction())
+            parent_texts = {}
+            for revision_id in versions:
+                if revision_id in versionedfile:
+                    continue
+                parents = parent_map[revision_id]
+                # We drop revision parents with different file-ids, because
+                # a version cannot have a version with another file-id as its
+                # parent.
+                # When a parent revision is a ghost, we guess that its root id
+                # was unchanged.
+                parents = tuple(p for p in parents if p != NULL_REVISION
+                    and revision_root.get(p, root_id) == root_id)
+                result = versionedfile.add_lines_with_ghosts(
+                    revision_id, parents, [], parent_texts)
+                parent_texts[revision_id] = result[2]
 
     def regenerate_inventory(self, revs):
         """Generate a new inventory versionedfile in target, convertin data.
@@ -371,6 +408,10 @@
             self.target.add_inventory(tree.get_revision_id(), tree.inventory,
                                       parents)
 
+    def fetch_revisions(self, revision_ids):
+        for revision in self.source.get_revisions(revision_ids):
+            self.target.add_revision(revision.revision_id, revision)
+
 
 class Model1toKnit2Fetcher(GenericRepoFetcher):
     """Fetch from a Model1 repository into a Knit2 repository
@@ -386,7 +427,10 @@
 
     def _fetch_inventory_weave(self, revs, pb):
         self.helper.regenerate_inventory(revs)
- 
+
+    def _copy_revision(self, rev, to_txn):
+        self.helper.fetch_revisions([rev])
+
 
 class Knit1to2Fetcher(KnitRepoFetcher):
     """Fetch from a Knit1 repository into a Knit2 repository"""
@@ -403,6 +447,10 @@
     def _fetch_inventory_weave(self, revs, pb):
         self.helper.regenerate_inventory(revs)
 
+    def _fetch_just_revision_texts(self, version_ids, from_transaction,
+                                   to_transaction):
+        self.helper.fetch_revisions(version_ids)
+
 
 class RemoteToOtherFetcher(GenericRepoFetcher):
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-04-29 17:53:50 +0000
+++ b/bzrlib/repository.py	2008-04-30 06:54:40 +0000
@@ -542,14 +542,17 @@
             plaintext = Testament(rev, inv).as_short_text()
             self.store_revision_signature(
                 gpg.GPGStrategy(config), plaintext, revision_id)
-        if not revision_id in self.get_inventory_weave():
+        inventory_vf = self.get_inventory_weave()
+        if not revision_id in inventory_vf:
             if inv is None:
                 raise errors.WeaveRevisionNotPresent(revision_id,
-                                                     self.get_inventory_weave())
+                                                     inventory_vf)
             else:
                 # yes, this is not suitable for adding with ghosts.
-                rev.inventory_sha1 = self.add_inventory(revision_id, inv, 
+                rev.inventory_sha1 = self.add_inventory(revision_id, inv,
                                                         rev.parent_ids)
+        else:
+            rev.inventory_sha1 = inventory_vf.get_sha1s([revision_id])[0]
         self._revision_store.add_revision(rev, self.get_transaction())
 
     def _add_revision_text(self, revision_id, text):

=== modified file 'bzrlib/tests/interrepository_implementations/__init__.py'
--- a/bzrlib/tests/interrepository_implementations/__init__.py	2008-03-24 15:44:44 +0000
+++ b/bzrlib/tests/interrepository_implementations/__init__.py	2008-04-25 21:36:59 +0000
@@ -25,6 +25,12 @@
 rather than in tests/interrepository_implementations/*.py.
 """
 
+
+from bzrlib.errors import (
+    FileExists,
+    UninitializableFormat,
+    )
+
 from bzrlib.repository import (
                                InterKnitRepo,
                                InterKnit1and2,
@@ -38,6 +44,8 @@
                           TestScenarioApplier,
                           TestSuite,
                           )
+from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
+from bzrlib.transport import get_transport
 
 
 class InterRepositoryTestProviderAdapter(TestScenarioApplier):
@@ -119,9 +127,46 @@
         return result
 
 
+class TestCaseWithInterRepository(TestCaseWithBzrDir):
+
+    def setUp(self):
+        super(TestCaseWithInterRepository, self).setUp()
+
+    def make_branch(self, relpath, format=None):
+        repo = self.make_repository(relpath, format=format)
+        return repo.bzrdir.create_branch()
+
+    def make_bzrdir(self, relpath, format=None):
+        try:
+            url = self.get_url(relpath)
+            segments = url.split('/')
+            if segments and segments[-1] not in ('', '.'):
+                parent = '/'.join(segments[:-1])
+                t = get_transport(parent)
+                try:
+                    t.mkdir(segments[-1])
+                except FileExists:
+                    pass
+            if format is None:
+                format = self.repository_format._matchingbzrdir
+            return format.initialize(url)
+        except UninitializableFormat:
+            raise TestSkipped("Format %s is not initializable." % format)
+
+    def make_repository(self, relpath, format=None):
+        made_control = self.make_bzrdir(relpath, format=format)
+        return self.repository_format.initialize(made_control)
+
+    def make_to_repository(self, relpath):
+        made_control = self.make_bzrdir(relpath,
+            self.repository_format_to._matchingbzrdir)
+        return self.repository_format_to.initialize(made_control)
+
+
 def test_suite():
     result = TestSuite()
     test_interrepository_implementations = [
+        'bzrlib.tests.interrepository_implementations.test_fetch',
         'bzrlib.tests.interrepository_implementations.test_interrepository',
         ]
     adapter = InterRepositoryTestProviderAdapter(

=== modified file 'bzrlib/tests/interrepository_implementations/test_interrepository.py'
--- a/bzrlib/tests/interrepository_implementations/test_interrepository.py	2008-04-26 06:07:28 +0000
+++ b/bzrlib/tests/interrepository_implementations/test_interrepository.py	2008-04-27 22:35:42 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006 Canonical Ltd
+# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,12 +22,6 @@
 import bzrlib.bzrdir as bzrdir
 from bzrlib.branch import Branch, needs_read_lock, needs_write_lock
 import bzrlib.errors as errors
-from bzrlib.errors import (FileExists,
-                           NoSuchRevision,
-                           NoSuchFile,
-                           UninitializableFormat,
-                           NotBranchError,
-                           )
 import bzrlib.gpg
 from bzrlib.inventory import Inventory
 import bzrlib.repofmt.weaverepo as weaverepo
@@ -40,44 +34,9 @@
     TestNotApplicable,
     TestSkipped,
     )
-from bzrlib.tests.bzrdir_implementations.test_bzrdir import TestCaseWithBzrDir
-from bzrlib.transport import get_transport
-
-
-class TestCaseWithInterRepository(TestCaseWithBzrDir):
-
-    def setUp(self):
-        super(TestCaseWithInterRepository, self).setUp()
-
-    def make_branch(self, relpath, format=None):
-        repo = self.make_repository(relpath, format=format)
-        return repo.bzrdir.create_branch()
-
-    def make_bzrdir(self, relpath, format=None):
-        try:
-            url = self.get_url(relpath)
-            segments = url.split('/')
-            if segments and segments[-1] not in ('', '.'):
-                parent = '/'.join(segments[:-1])
-                t = get_transport(parent)
-                try:
-                    t.mkdir(segments[-1])
-                except FileExists:
-                    pass
-            if format is None:
-                format = self.repository_format._matchingbzrdir
-            return format.initialize(url)
-        except UninitializableFormat:
-            raise TestSkipped("Format %s is not initializable." % format)
-
-    def make_repository(self, relpath, format=None):
-        made_control = self.make_bzrdir(relpath, format=format)
-        return self.repository_format.initialize(made_control)
-
-    def make_to_repository(self, relpath):
-        made_control = self.make_bzrdir(relpath,
-            self.repository_format_to._matchingbzrdir)
-        return self.repository_format_to.initialize(made_control)
+from bzrlib.tests.interrepository_implementations import (
+    TestCaseWithInterRepository,
+    )
 
 
 def check_old_format_lock_error(repository_format):
@@ -131,138 +90,6 @@
         ## self.assertEqual(self.interrepo_class, interrepo.__class__)
         pass
 
-    def test_fetch(self):
-        tree_a = self.make_branch_and_tree('a')
-        self.build_tree(['a/foo'])
-        tree_a.add('foo', 'file1')
-        tree_a.commit('rev1', rev_id='rev1')
-        def check_push_rev1(repo):
-            # ensure the revision is missing.
-            self.assertRaises(NoSuchRevision, repo.get_revision, 'rev1')
-            # fetch with a limit of NULL_REVISION and an explicit progress bar.
-            repo.fetch(tree_a.branch.repository,
-                       revision_id=NULL_REVISION,
-                       pb=bzrlib.progress.DummyProgress())
-            # nothing should have been pushed
-            self.assertFalse(repo.has_revision('rev1'))
-            # fetch with a default limit (grab everything)
-            repo.fetch(tree_a.branch.repository)
-            # check that b now has all the data from a's first commit.
-            rev = repo.get_revision('rev1')
-            tree = repo.revision_tree('rev1')
-            tree.lock_read()
-            self.addCleanup(tree.unlock)
-            tree.get_file_text('file1')
-            for file_id in tree:
-                if tree.inventory[file_id].kind == "file":
-                    tree.get_file(file_id).read()
-
-        # makes a target version repo 
-        repo_b = self.make_to_repository('b')
-        check_push_rev1(repo_b)
-
-    def test_fetch_missing_basis_text(self):
-        """If fetching a delta, we should die if a basis is not present."""
-        tree = self.make_branch_and_tree('tree')
-        self.build_tree(['tree/a'])
-        tree.add(['a'], ['a-id'])
-        tree.commit('one', rev_id='rev-one')
-        self.build_tree_contents([('tree/a', 'new contents\n')])
-        tree.commit('two', rev_id='rev-two')
-
-        to_repo = self.make_to_repository('to_repo')
-        # We build a broken revision so that we can test the fetch code dies
-        # properly. So copy the inventory and revision, but not the text.
-        to_repo.lock_write()
-        try:
-            to_repo.start_write_group()
-            inv = tree.branch.repository.get_inventory('rev-one')
-            to_repo.add_inventory('rev-one', inv, [])
-            rev = tree.branch.repository.get_revision('rev-one')
-            to_repo.add_revision('rev-one', rev, inv=inv)
-            to_repo.commit_write_group()
-        finally:
-            to_repo.unlock()
-
-        # Implementations can either copy the missing basis text, or raise an
-        # exception
-        try:
-            to_repo.fetch(tree.branch.repository, 'rev-two')
-        except errors.RevisionNotPresent, e:
-            # If an exception is raised, the revision should not be in the
-            # target.
-            self.assertRaises((errors.NoSuchRevision, errors.RevisionNotPresent),
-                              to_repo.revision_tree, 'rev-two')
-        else:
-            # If not exception is raised, then the basis text should be
-            # available.
-            to_repo.lock_read()
-            try:
-                rt = to_repo.revision_tree('rev-one')
-                self.assertEqual('contents of tree/a\n',
-                                 rt.get_file_text('a-id'))
-            finally:
-                to_repo.unlock()
-
-    def test_fetch_missing_revision_same_location_fails(self):
-        repo_a = self.make_repository('.')
-        repo_b = repository.Repository.open('.')
-        try:
-            self.assertRaises(errors.NoSuchRevision, repo_b.fetch, repo_a, revision_id='XXX')
-        except errors.LockError, e:
-            check_old_format_lock_error(self.repository_format)
-
-    def test_fetch_same_location_trivial_works(self):
-        repo_a = self.make_repository('.')
-        repo_b = repository.Repository.open('.')
-        try:
-            repo_a.fetch(repo_b)
-        except errors.LockError, e:
-            check_old_format_lock_error(self.repository_format)
-
-    def test_fetch_missing_text_other_location_fails(self):
-        source_tree = self.make_branch_and_tree('source')
-        source = source_tree.branch.repository
-        target = self.make_to_repository('target')
-    
-        # start by adding a file so the data knit for the file exists in
-        # repositories that have specific files for each fileid.
-        self.build_tree(['source/id'])
-        source_tree.add(['id'], ['id'])
-        source_tree.commit('a', rev_id='a')
-        # now we manually insert a revision with an inventory referencing
-        # 'id' at revision 'b', but we do not insert revision b.
-        # this should ensure that the new versions of files are being checked
-        # for during pull operations
-        inv = source.get_inventory('a')
-        source.lock_write()
-        self.addCleanup(source.unlock)
-        source.start_write_group()
-        inv['id'].revision = 'b'
-        inv.revision_id = 'b'
-        sha1 = source.add_inventory('b', inv, ['a'])
-        rev = Revision(timestamp=0,
-                       timezone=None,
-                       committer="Foo Bar <foo at example.com>",
-                       message="Message",
-                       inventory_sha1=sha1,
-                       revision_id='b')
-        rev.parent_ids = ['a']
-        source.add_revision('b', rev)
-        source.commit_write_group()
-        self.assertRaises(errors.RevisionNotPresent, target.fetch, source)
-        self.assertFalse(target.has_revision('b'))
-
-    def test_fetch_funky_file_id(self):
-        from_tree = self.make_branch_and_tree('tree')
-        if sys.platform == 'win32':
-            from_repo = from_tree.branch.repository
-            check_repo_format_for_funky_id_on_win32(from_repo)
-        self.build_tree(['tree/filename'])
-        from_tree.add('filename', 'funky-chars<>%&;"\'')
-        from_tree.commit('commit filename')
-        to_repo = self.make_to_repository('to')
-        to_repo.fetch(from_tree.branch.repository, from_tree.get_parent_ids()[0])
 
 
 class TestCaseWithComplexRepository(TestCaseWithInterRepository):
@@ -325,10 +152,12 @@
         self.assertFalse(repo_a.has_revision('pizza'))
         self.assertFalse(repo_b.has_revision('pizza'))
         # Asking specifically for an absent revision errors.
-        self.assertRaises(NoSuchRevision, repo_b.search_missing_revision_ids, repo_a,
-            revision_id='pizza', find_ghosts=True)
-        self.assertRaises(NoSuchRevision, repo_b.search_missing_revision_ids, repo_a,
-            revision_id='pizza', find_ghosts=False)
+        self.assertRaises(errors.NoSuchRevision,
+            repo_b.search_missing_revision_ids, repo_a, revision_id='pizza',
+            find_ghosts=True)
+        self.assertRaises(errors.NoSuchRevision,
+            repo_b.search_missing_revision_ids, repo_a, revision_id='pizza',
+            find_ghosts=False)
 
     def test_search_missing_revision_ids_revision_limited(self):
         # revision ids in repository A that are not referenced by the
@@ -404,31 +233,3 @@
         # rev must not be corrupt now
         self.assertEqual([None, 'ghost', 'references', 'tip'],
             missing_ghost.get_ancestry('tip'))
-
-
-class TestFetchDependentData(TestCaseWithInterRepository):
-
-    def test_reference(self):
-        from_tree = self.make_branch_and_tree('tree')
-        to_repo = self.make_to_repository('to')
-        if (not from_tree.supports_tree_reference() or
-            not from_tree.branch.repository._format.supports_tree_reference or
-            not to_repo._format.supports_tree_reference):
-            raise TestNotApplicable("Need subtree support.")
-        subtree = self.make_branch_and_tree('tree/subtree')
-        subtree.commit('subrev 1')
-        from_tree.add_reference(subtree)
-        tree_rev = from_tree.commit('foo')
-        # now from_tree has a last-modified of subtree of the rev id of the
-        # commit for foo, and a reference revision of the rev id of the commit
-        # for subrev 1
-        to_repo.fetch(from_tree.branch.repository, tree_rev)
-        # to_repo should have a file_graph for from_tree.path2id('subtree') and
-        # revid tree_rev.
-        to_repo.lock_read()
-        try:
-            file_vf = to_repo.weave_store.get_weave(
-                from_tree.path2id('subtree'), to_repo.get_transaction())
-            self.assertEqual([tree_rev], file_vf.get_ancestry([tree_rev]))
-        finally:
-            to_repo.unlock()

=== modified file 'bzrlib/tests/test_bundle.py'
--- a/bzrlib/tests/test_bundle.py	2008-03-26 03:06:52 +0000
+++ b/bzrlib/tests/test_bundle.py	2008-04-28 03:55:56 +0000
@@ -42,7 +42,7 @@
                            NoSuchFile,)
 from bzrlib.merge import Merge3Merger
 from bzrlib.repofmt import knitrepo
-from bzrlib.osutils import sha_file
+from bzrlib.osutils import sha_file, sha_string
 from bzrlib.tests import (
     SymlinkFeature,
     TestCase,
@@ -1015,19 +1015,29 @@
         self.assertNotContainsRe(inv_text, 'format="5"')
         self.assertContainsRe(inv_text, 'format="7"')
 
+    def make_repo_with_installed_revisions(self):
+        tree = self.make_simple_tree('knit')
+        tree.commit('hello', rev_id='rev1')
+        tree.commit('hello', rev_id='rev2')
+        bundle = read_bundle(self.create_bundle_text('null:', 'rev2')[0])
+        repo = self.make_repository('repo', format='dirstate-with-subtree')
+        bundle.install_revisions(repo)
+        return repo
+
     def test_across_models(self):
-        tree = self.make_simple_tree('knit')
-        tree.commit('hello', rev_id='rev1')
-        tree.commit('hello', rev_id='rev2')
-        bundle = read_bundle(self.create_bundle_text('null:', 'rev2')[0])
-        repo = self.make_repository('repo', format='dirstate-with-subtree')
-        bundle.install_revisions(repo)
+        repo = self.make_repo_with_installed_revisions()
         inv = repo.get_inventory('rev2')
         self.assertEqual('rev2', inv.root.revision)
         root_vf = repo.weave_store.get_weave(inv.root.file_id,
                                              repo.get_transaction())
         self.assertEqual(root_vf.versions(), ['rev1', 'rev2'])
 
+    def test_inv_hash_across_serializers(self):
+        repo = self.make_repo_with_installed_revisions()
+        recorded_inv_sha1 = repo.get_inventory_sha1('rev2')
+        xml = repo.get_inventory_xml('rev2')
+        self.assertEqual(sha_string(xml), recorded_inv_sha1)
+
     def test_across_models_incompatible(self):
         tree = self.make_simple_tree('dirstate-with-subtree')
         tree.commit('hello', rev_id='rev1')

=== modified file 'bzrlib/tests/test_fetch.py'
--- a/bzrlib/tests/test_fetch.py	2008-04-28 03:52:09 +0000
+++ b/bzrlib/tests/test_fetch.py	2008-04-30 04:50:30 +0000
@@ -322,3 +322,75 @@
         self.assertTrue(1 >= self._count_log_matches('last-revision',
                                                      http_logs))
         self.assertEqual(4, len(http_logs))
+
+
+class Test1To2Fetch(TestCaseWithTransport):
+    """Tests for Model1To2 failure modes"""
+
+    def make_tree_and_repo(self):
+        self.tree = self.make_branch_and_tree('tree', format='pack-0.92')
+        self.repo = self.make_repository('rich-repo', format='rich-root-pack')
+        self.repo.lock_write()
+        self.addCleanup(self.repo.unlock)
+
+    def do_fetch_order_test(self, first, second):
+        """Test that fetch works no matter what the set order of revision is.
+
+        This test depends on the order of items in a set, which is
+        implementation-dependant, so we test A, B and then B, A.
+        """
+        self.make_tree_and_repo()
+        self.tree.commit('Commit 1', rev_id=first)
+        self.tree.commit('Commit 2', rev_id=second)
+        self.repo.fetch(self.tree.branch.repository, second)
+
+    def test_fetch_order_AB(self):
+        """See do_fetch_order_test"""
+        self.do_fetch_order_test('A', 'B')
+
+    def test_fetch_order_BA(self):
+        """See do_fetch_order_test"""
+        self.do_fetch_order_test('B', 'A')
+
+    def get_parents(self, file_id, revision_id):
+        transaction = self.repo.get_transaction()
+        vf = self.repo.weave_store.get_weave(file_id, transaction)
+        return vf.get_parents_with_ghosts(revision_id)
+
+    def test_fetch_ghosts(self):
+        self.make_tree_and_repo()
+        self.tree.commit('first commit', rev_id='left-parent')
+        self.tree.add_parent_tree_id('ghost-parent')
+        fork = self.tree.bzrdir.sprout('fork', 'null:').open_workingtree()
+        fork.commit('not a ghost', rev_id='not-ghost-parent')
+        self.tree.branch.repository.fetch(fork.branch.repository,
+                                     'not-ghost-parent')
+        self.tree.add_parent_tree_id('not-ghost-parent')
+        self.tree.commit('second commit', rev_id='second-id')
+        self.repo.fetch(self.tree.branch.repository, 'second-id')
+        root_id = self.tree.get_root_id()
+        self.assertEqual(['left-parent', 'ghost-parent', 'not-ghost-parent'],
+                         self.get_parents(root_id, 'second-id'))
+
+    def make_two_commits(self, change_root, fetch_twice):
+        self.make_tree_and_repo()
+        self.tree.commit('first commit', rev_id='first-id')
+        if change_root:
+            self.tree.set_root_id('unique-id')
+        self.tree.commit('second commit', rev_id='second-id')
+        if fetch_twice:
+            self.repo.fetch(self.tree.branch.repository, 'first-id')
+        self.repo.fetch(self.tree.branch.repository, 'second-id')
+
+    def test_fetch_changed_root(self):
+        self.make_two_commits(change_root=True, fetch_twice=False)
+        self.assertEqual([], self.get_parents('unique-id', 'second-id'))
+
+    def test_two_fetch_changed_root(self):
+        self.make_two_commits(change_root=True, fetch_twice=True)
+        self.assertEqual([], self.get_parents('unique-id', 'second-id'))
+
+    def test_two_fetches(self):
+        self.make_two_commits(change_root=False, fetch_twice=True)
+        self.assertEqual(['first-id'],
+                         self.get_parents('TREE_ROOT', 'second-id'))




More information about the bazaar-commits mailing list