~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_patches.py

  • Committer: Patch Queue Manager
  • Date: 2015-09-30 16:43:21 UTC
  • mfrom: (6603.2.2 fix-keep-dirty)
  • Revision ID: pqm@pqm.ubuntu.com-20150930164321-ct2v2qnmvimqt8qf
(vila) Avoid associating dirty patch headers with the previous file in the
 patch. (Colin Watson)

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
        lines = ["=== added directory 'foo/bar'\n",
68
68
                 "=== modified file 'orig/commands.py'\n",
69
69
                 "--- orig/commands.py\n",
70
 
                 "+++ mod/dommands.py\n"]
 
70
                 "+++ mod/dommands.py\n",
 
71
                 "=== modified file 'orig/another.py'\n",
 
72
                 "--- orig/another.py\n",
 
73
                 "+++ mod/another.py\n"]
71
74
        patches = parse_patches(
72
75
            lines.__iter__(), allow_dirty=True, keep_dirty=True)
 
76
        self.assertLength(2, patches)
73
77
        self.assertEqual(patches[0]['dirty_head'],
74
78
                         ["=== added directory 'foo/bar'\n",
75
79
                          "=== modified file 'orig/commands.py'\n"])
76
80
        self.assertEqual(patches[0]['patch'].get_header().splitlines(True),
77
81
                         ["--- orig/commands.py\n", "+++ mod/dommands.py\n"])
 
82
        self.assertEqual(patches[1]['dirty_head'],
 
83
                         ["=== modified file 'orig/another.py'\n"])
 
84
        self.assertEqual(patches[1]['patch'].get_header().splitlines(True),
 
85
                         ["--- orig/another.py\n", "+++ mod/another.py\n"])
78
86
 
79
87
    def testValidPatchHeader(self):
80
88
        """Parse a valid patch header"""