| 1 | # -*- mode: python; coding: utf-8 -*- |
|---|
| 2 | # :Progetto: vcpx -- Operational tests |
|---|
| 3 | # :Creato: lun 08 ago 2005 22:17:10 CEST |
|---|
| 4 | # :Autore: Lele Gaifax <lele@nautilus.homeip.net> |
|---|
| 5 | # :Licenza: GNU General Public License |
|---|
| 6 | # |
|---|
| 7 | |
|---|
| 8 | """\ |
|---|
| 9 | #!tailor |
|---|
| 10 | ''' |
|---|
| 11 | [DEFAULT] |
|---|
| 12 | target-module = None |
|---|
| 13 | source-repository = %(tailor_repo)s |
|---|
| 14 | encoding = None |
|---|
| 15 | target-repository = None |
|---|
| 16 | use-svn-propset = False |
|---|
| 17 | source-module = None |
|---|
| 18 | update = True |
|---|
| 19 | subdir = test |
|---|
| 20 | debug = False |
|---|
| 21 | remove-first-log-line = False |
|---|
| 22 | patch-name-format = None |
|---|
| 23 | verbose = False |
|---|
| 24 | state-file = tailor.state |
|---|
| 25 | start-revision = Version 0.9.17 |
|---|
| 26 | |
|---|
| 27 | [darcs2bzr] |
|---|
| 28 | target = bzr:tailor |
|---|
| 29 | root-directory = %(testdir)s/darcs2bzr |
|---|
| 30 | source = darcs:tailor |
|---|
| 31 | patch-name-format = %(revision)s |
|---|
| 32 | |
|---|
| 33 | [bzr2darcs] |
|---|
| 34 | source = bzr:tailor |
|---|
| 35 | root-directory = %(testdir)s/bzr2darcs |
|---|
| 36 | target = darcs:bzrtailor |
|---|
| 37 | patch-name-format = %(revision)s |
|---|
| 38 | start-revision = INITIAL |
|---|
| 39 | |
|---|
| 40 | [darcs:tailor] |
|---|
| 41 | |
|---|
| 42 | [bzr:tailor] |
|---|
| 43 | repository = %(testdir)s/darcs2bzr |
|---|
| 44 | |
|---|
| 45 | [darcs:bzrtailor] |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | [darcs2cdv] |
|---|
| 49 | target = cdv:tailor |
|---|
| 50 | root-directory = %(testdir)s/darcs2cdv |
|---|
| 51 | source = darcs:tailor |
|---|
| 52 | |
|---|
| 53 | [cdv:tailor] |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | [darcs2hg] |
|---|
| 57 | target = hg:tailor |
|---|
| 58 | root-directory = %(testdir)s/darcs2hg |
|---|
| 59 | source = darcs:tailor |
|---|
| 60 | |
|---|
| 61 | [hg:tailor] |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | [darcs2svn] |
|---|
| 65 | target = svn:tailor |
|---|
| 66 | root-directory = %(testdir)s/darcs2svn |
|---|
| 67 | source = darcs:svntailor |
|---|
| 68 | start-revision = INITIAL |
|---|
| 69 | |
|---|
| 70 | [svn2darcs] |
|---|
| 71 | target = darcs:svntailor |
|---|
| 72 | root-directory = %(testdir)s/svn2darcs |
|---|
| 73 | source = svn:tailor |
|---|
| 74 | start-revision = 1 |
|---|
| 75 | |
|---|
| 76 | [svn:tailor] |
|---|
| 77 | repository = file://%(testdir)s/svnrepo |
|---|
| 78 | module = tailor |
|---|
| 79 | subdir = svnside |
|---|
| 80 | use-propset = True |
|---|
| 81 | |
|---|
| 82 | [darcs:svntailor] |
|---|
| 83 | repository = %(tailor_repo)s |
|---|
| 84 | subdir = darcside |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | [darcs2monotone] |
|---|
| 88 | target = monotone:tailor |
|---|
| 89 | root-directory = %(testdir)s/darcs2monotone |
|---|
| 90 | source = darcs:tailor |
|---|
| 91 | |
|---|
| 92 | [monotone2darcs] |
|---|
| 93 | source = monotone:tailor |
|---|
| 94 | root-directory = %(testdir)s/monotone2darcs |
|---|
| 95 | target = darcs:mtntailor |
|---|
| 96 | start-revision = INITIAL |
|---|
| 97 | |
|---|
| 98 | [monotone:tailor] |
|---|
| 99 | keyid = tailor |
|---|
| 100 | passphrase = fin che la barca va |
|---|
| 101 | repository = %(testdir)s/tailor-mtn.db |
|---|
| 102 | module = tailor.test |
|---|
| 103 | subdir = mntside |
|---|
| 104 | |
|---|
| 105 | [darcs:mtntailor] |
|---|
| 106 | subdir = darcside |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | [cvs2darcs] |
|---|
| 110 | target = darcs:pxlib |
|---|
| 111 | root-directory = %(testdir)s/cvs2darcs |
|---|
| 112 | source = cvs:pxlib |
|---|
| 113 | start-revision = R-0-5-1 |
|---|
| 114 | subdir = pxlib |
|---|
| 115 | |
|---|
| 116 | [darcs:pxlib] |
|---|
| 117 | |
|---|
| 118 | [cvs:pxlib] |
|---|
| 119 | repository = :pserver:anonymous@pxlib.cvs.sourceforce.net:/cvsroot/pxlib |
|---|
| 120 | module = pxlib |
|---|
| 121 | encoding = iso-8859-1 |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | [darcs2cvs] |
|---|
| 125 | target = cvs:tailor |
|---|
| 126 | root-directory = %(testdir)s/darcs2cvs |
|---|
| 127 | source = darcs:tailor |
|---|
| 128 | |
|---|
| 129 | [cvs:tailor] |
|---|
| 130 | repository = :local:%(testdir)s/cvsrepo |
|---|
| 131 | module = tailor |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | [cvs2hg] |
|---|
| 135 | root-directory = %(testdir)s/cvs2hg |
|---|
| 136 | source = cvs:cmsmini |
|---|
| 137 | target = hg:cmsmini |
|---|
| 138 | start-revision = INITIAL |
|---|
| 139 | subdir = cmsmini |
|---|
| 140 | before-commit = remap_authors |
|---|
| 141 | |
|---|
| 142 | [cvs:cmsmini] |
|---|
| 143 | repository = :pserver:anonymous@cvs.savannah.nongnu.org:/sources/cmsmini |
|---|
| 144 | module = cmsmini |
|---|
| 145 | |
|---|
| 146 | [hg:cmsmini] |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | [cvs2bzr] |
|---|
| 150 | root-directory = %(testdir)s/cvs2bzr |
|---|
| 151 | source = cvs:atse |
|---|
| 152 | target = bzr:atse |
|---|
| 153 | start-revision = spamies-improvement-branch INITIAL |
|---|
| 154 | subdir = atse |
|---|
| 155 | |
|---|
| 156 | [cvs:atse] |
|---|
| 157 | repository = :pserver:anonymous@collective.cvs.sourceforge.net:/cvsroot/collective |
|---|
| 158 | module = ATSchemaEditorNG |
|---|
| 159 | |
|---|
| 160 | [bzr:atse] |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | [cvs2svn] |
|---|
| 164 | source = cvs:cmfeditions-houston-sprint |
|---|
| 165 | target = svn:cmfeditions |
|---|
| 166 | start-revision = houston-sprint-branch INITIAL |
|---|
| 167 | root-directory = %(testdir)s/cvs2svn |
|---|
| 168 | |
|---|
| 169 | [cvs:cmfeditions-houston-sprint] |
|---|
| 170 | repository = :pserver:anonymous@collective.cvs.sourceforge.net:/cvsroot/collective |
|---|
| 171 | module = CMFEditions |
|---|
| 172 | subdir = cvside |
|---|
| 173 | |
|---|
| 174 | [svn:cmfeditions] |
|---|
| 175 | repository = file://%(testdir)s/cmfeditions.svnrepo |
|---|
| 176 | module = cmfeditions |
|---|
| 177 | subdir = svnside |
|---|
| 178 | |
|---|
| 179 | |
|---|
| 180 | [svn2hg] |
|---|
| 181 | source = svn:plonebook |
|---|
| 182 | target = hg:plonebook |
|---|
| 183 | start-revision = 1101 |
|---|
| 184 | root-directory = %(testdir)s/svn2hg |
|---|
| 185 | |
|---|
| 186 | [svn:plonebook] |
|---|
| 187 | repository = http://docit.bice.dyndns.org |
|---|
| 188 | module = /Plone/PloneBook2/it |
|---|
| 189 | |
|---|
| 190 | [hg:plonebook] |
|---|
| 191 | |
|---|
| 192 | [svn2hg_with_externals] |
|---|
| 193 | source = svn:plonebook_we |
|---|
| 194 | target = hg:plonebook |
|---|
| 195 | start-revision = HEAD |
|---|
| 196 | root-directory = %(testdir)s/svn2hg_we |
|---|
| 197 | |
|---|
| 198 | [svn:plonebook_we] |
|---|
| 199 | repository = http://docit.bice.dyndns.org |
|---|
| 200 | module = /Plone/PloneBook2/it |
|---|
| 201 | ignore-externals = False |
|---|
| 202 | |
|---|
| 203 | |
|---|
| 204 | [bazaarng2darcs] |
|---|
| 205 | source = bzr:oodoctest |
|---|
| 206 | target = darcs:oodoctest |
|---|
| 207 | root-directory = %(testdir)s/bazaarng2darcs |
|---|
| 208 | start-revision = INITIAL |
|---|
| 209 | |
|---|
| 210 | [bzr:oodoctest] |
|---|
| 211 | repository = http://download.gna.org/oodoctest/oodoctest.og.main/ |
|---|
| 212 | |
|---|
| 213 | [darcs:oodoctest] |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | [darcs_rename_delete] |
|---|
| 217 | source = darcs:darcs_rename_delete |
|---|
| 218 | target = svn:darcs_rename_delete |
|---|
| 219 | root-directory = %(testdir)s/darcs_rename_delete |
|---|
| 220 | start-revision = INITIAL |
|---|
| 221 | |
|---|
| 222 | [darcs:darcs_rename_delete] |
|---|
| 223 | repository = %(testdir)s/rename_delete |
|---|
| 224 | subdir = darcs |
|---|
| 225 | |
|---|
| 226 | [svn:darcs_rename_delete] |
|---|
| 227 | repository = file://%(testdir)s/darcs_rename_delete.svnrepo |
|---|
| 228 | module = / |
|---|
| 229 | subdir = svn |
|---|
| 230 | |
|---|
| 231 | |
|---|
| 232 | [darcs_rename_delete_dir] |
|---|
| 233 | source = darcs:darcs_rename_delete_dir |
|---|
| 234 | target = svn:darcs_rename_delete_dir |
|---|
| 235 | root-directory = %(testdir)s/darcs_rename_delete_dir |
|---|
| 236 | start-revision = INITIAL |
|---|
| 237 | |
|---|
| 238 | [darcs:darcs_rename_delete_dir] |
|---|
| 239 | repository = %(testdir)s/rename_delete_dir |
|---|
| 240 | subdir = darcs |
|---|
| 241 | |
|---|
| 242 | [svn:darcs_rename_delete_dir] |
|---|
| 243 | repository = file://%(testdir)s/darcs_rename_delete_dir.svnrepo |
|---|
| 244 | module = / |
|---|
| 245 | subdir = svn |
|---|
| 246 | |
|---|
| 247 | ''' |
|---|
| 248 | |
|---|
| 249 | def remap_authors(context, changeset): |
|---|
| 250 | if changeset.author == 'tizziano': |
|---|
| 251 | changeset.author = 'tiziano' |
|---|
| 252 | return True |
|---|
| 253 | """ |
|---|
| 254 | |
|---|
| 255 | from unittest import TestCase |
|---|
| 256 | from cStringIO import StringIO |
|---|
| 257 | from vcpx import TailorException |
|---|
| 258 | from vcpx.config import Config |
|---|
| 259 | from vcpx.tailor import Tailorizer |
|---|
| 260 | from vcpx.shwrap import ExternalCommand, PIPE |
|---|
| 261 | |
|---|
| 262 | |
|---|
| 263 | class OperationalTest(TestCase): |
|---|
| 264 | |
|---|
| 265 | TESTDIR = '/tmp/tailor-tests' |
|---|
| 266 | |
|---|
| 267 | def setUp(self): |
|---|
| 268 | from os import mkdir, getcwd |
|---|
| 269 | from os.path import exists, split, join |
|---|
| 270 | from atexit import register |
|---|
| 271 | from shutil import rmtree |
|---|
| 272 | |
|---|
| 273 | tailor_repo = getcwd() |
|---|
| 274 | while tailor_repo != '/' and not exists(join(tailor_repo, '_darcs')): |
|---|
| 275 | tailor_repo = split(tailor_repo)[0] |
|---|
| 276 | assert exists(join(tailor_repo, '_darcs')), "Tailor Darcs repository not found!" |
|---|
| 277 | self.tailor_repo = tailor_repo |
|---|
| 278 | self.config = Config(StringIO(__doc__), {'tailor_repo': tailor_repo, |
|---|
| 279 | 'testdir': self.TESTDIR}) |
|---|
| 280 | if not exists(self.TESTDIR): |
|---|
| 281 | mkdir(self.TESTDIR) |
|---|
| 282 | register(rmtree, self.TESTDIR) |
|---|
| 283 | |
|---|
| 284 | def diffWhenPossible(self, tailorizer): |
|---|
| 285 | "Diff the resulting sides" |
|---|
| 286 | |
|---|
| 287 | dwd = tailorizer.workingDir() |
|---|
| 288 | if not dwd.shared_basedirs: |
|---|
| 289 | cmd = ["diff", "-r", "-u"] |
|---|
| 290 | if tailorizer.source.METADIR: |
|---|
| 291 | cmd.extend(["-x", tailorizer.source.METADIR]) |
|---|
| 292 | if tailorizer.target.METADIR: |
|---|
| 293 | cmd.extend(["-x", tailorizer.target.METADIR]) |
|---|
| 294 | d = ExternalCommand(command=cmd) |
|---|
| 295 | out = d.execute(dwd.source.repository.basedir, |
|---|
| 296 | dwd.target.repository.basedir, |
|---|
| 297 | stdout=PIPE)[0] |
|---|
| 298 | return out.read() |
|---|
| 299 | else: |
|---|
| 300 | return "" |
|---|
| 301 | |
|---|
| 302 | def tailorize(self, project): |
|---|
| 303 | "The actual test" |
|---|
| 304 | |
|---|
| 305 | tailorizer = Tailorizer(project, self.config) |
|---|
| 306 | self.assert_(not tailorizer.exists(), |
|---|
| 307 | "For test purposes, better start from scratch!") |
|---|
| 308 | tailorizer() |
|---|
| 309 | self.assertEqual(self.diffWhenPossible(tailorizer), "") |
|---|
| 310 | |
|---|
| 311 | class Darcs(OperationalTest): |
|---|
| 312 | "Test darcs backend" |
|---|
| 313 | |
|---|
| 314 | def testConfiguration(self): |
|---|
| 315 | "Test basic configuration" |
|---|
| 316 | |
|---|
| 317 | p = Tailorizer('darcs2svn', self.config) |
|---|
| 318 | self.assertEqual(p.source.subdir, 'darcside') |
|---|
| 319 | self.assertEqual(p.rootdir, '%s/darcs2svn' % self.TESTDIR) |
|---|
| 320 | self.assertEqual(p.source.repository, self.tailor_repo) |
|---|
| 321 | self.assertEqual(p.target.repository, |
|---|
| 322 | 'file://%s/svnrepo' % self.TESTDIR) |
|---|
| 323 | self.assertEqual(p.state_file.filename, |
|---|
| 324 | '%s/darcs2svn/tailor.state' % self.TESTDIR) |
|---|
| 325 | |
|---|
| 326 | tailorizer = Tailorizer('cvs2darcs', self.config) |
|---|
| 327 | self.assertEqual(tailorizer.subdir, 'pxlib') |
|---|
| 328 | self.assertEqual(tailorizer.source.subdir, 'pxlib') |
|---|
| 329 | |
|---|
| 330 | def testDarcsAndBazaarng(self): |
|---|
| 331 | "Test darcs to bazaar-ng and the other way around" |
|---|
| 332 | |
|---|
| 333 | self.tailorize('darcs2bzr') |
|---|
| 334 | self.tailorize('bzr2darcs') |
|---|
| 335 | |
|---|
| 336 | def testDarcsToMercurial(self): |
|---|
| 337 | "Test darcs to mercurial" |
|---|
| 338 | |
|---|
| 339 | self.tailorize('darcs2hg') |
|---|
| 340 | |
|---|
| 341 | def testDarcsToCodeville(self): |
|---|
| 342 | "Test darcs to codeville" |
|---|
| 343 | |
|---|
| 344 | self.tailorize('darcs2cdv') |
|---|
| 345 | |
|---|
| 346 | def testDarcsAndSubversion(self): |
|---|
| 347 | "Test darcs to subversion and the other way around" |
|---|
| 348 | |
|---|
| 349 | self.tailorize('darcs2svn') |
|---|
| 350 | self.tailorize('svn2darcs') |
|---|
| 351 | |
|---|
| 352 | def testDarcsAndMonotone(self): |
|---|
| 353 | "Test darcs to monotone and the other way around" |
|---|
| 354 | |
|---|
| 355 | self.tailorize('darcs2monotone') |
|---|
| 356 | self.tailorize('monotone2darcs') |
|---|
| 357 | |
|---|
| 358 | |
|---|
| 359 | class Bazaarng(OperationalTest): |
|---|
| 360 | "Test the BazaarNG source backend" |
|---|
| 361 | |
|---|
| 362 | def testBazaarngAndPython23(self): |
|---|
| 363 | "Test we detect early when running under Python < 2.4" |
|---|
| 364 | |
|---|
| 365 | from sys import version_info |
|---|
| 366 | |
|---|
| 367 | if version_info < (2,4): |
|---|
| 368 | try: |
|---|
| 369 | self.tailorize('bazaarng2darcs') |
|---|
| 370 | except TailorException, e: |
|---|
| 371 | self.assert_("Bazaar-NG backend requires Python 2.4" |
|---|
| 372 | in str(e)) |
|---|
| 373 | else: |
|---|
| 374 | self.fail("Expected a specific TailorException") |
|---|
| 375 | |
|---|
| 376 | def testBazaarngToDarcs(self): |
|---|
| 377 | "Test bazaar-ng to darcs" |
|---|
| 378 | |
|---|
| 379 | try: |
|---|
| 380 | self.tailorize('bazaarng2darcs') |
|---|
| 381 | except TailorException, e: |
|---|
| 382 | from sys import version_info |
|---|
| 383 | |
|---|
| 384 | if version_info < (2,4): |
|---|
| 385 | # Under python 2.3 we expect an exception here, but |
|---|
| 386 | # different from the above: since we are still in a |
|---|
| 387 | # single python session importing the bzr stuff does |
|---|
| 388 | # not raise the same error, because from the python |
|---|
| 389 | # runtime pov the module is already loaded and thus |
|---|
| 390 | # the second import does not fail. The repository |
|---|
| 391 | # class will then instantiate the raw Repository |
|---|
| 392 | # class, not the specific bzr one. Still, when asked |
|---|
| 393 | # for a working dir, it will fail again |
|---|
| 394 | self.assert_("object has no attribute 'BzrWorkingDir'" |
|---|
| 395 | in str(e)) |
|---|
| 396 | else: |
|---|
| 397 | raise |
|---|
| 398 | |
|---|
| 399 | |
|---|
| 400 | |
|---|
| 401 | class Cvs(OperationalTest): |
|---|
| 402 | "Test the CVS source backend" |
|---|
| 403 | |
|---|
| 404 | def testCvsToDarcs(self): |
|---|
| 405 | "Test CVS to darcs" |
|---|
| 406 | |
|---|
| 407 | self.tailorize('cvs2darcs') |
|---|
| 408 | |
|---|
| 409 | def testDarcsToCvs(self): |
|---|
| 410 | "Test Darcs to CVS" |
|---|
| 411 | |
|---|
| 412 | self.tailorize('darcs2cvs') |
|---|
| 413 | |
|---|
| 414 | def testCvsToMercurial(self): |
|---|
| 415 | "Test CVS to mercurial" |
|---|
| 416 | |
|---|
| 417 | self.tailorize('cvs2hg') |
|---|
| 418 | |
|---|
| 419 | def testCvsToBazaarng(self): |
|---|
| 420 | "Test CVS to bazaar-ng" |
|---|
| 421 | |
|---|
| 422 | self.tailorize('cvs2bzr') |
|---|
| 423 | |
|---|
| 424 | def testCvsToSubversion(self): |
|---|
| 425 | "Test CVS branch to Subversion" |
|---|
| 426 | |
|---|
| 427 | self.tailorize('cvs2svn') |
|---|
| 428 | |
|---|
| 429 | |
|---|
| 430 | class Svn(OperationalTest): |
|---|
| 431 | "Test the subversion backend" |
|---|
| 432 | |
|---|
| 433 | def testExternals(self): |
|---|
| 434 | "Exercise svn to mercurial with and without svn:externals" |
|---|
| 435 | |
|---|
| 436 | from os.path import exists |
|---|
| 437 | |
|---|
| 438 | external = self.TESTDIR + '/svn2hg%s/test/make/docutils.make' |
|---|
| 439 | self.tailorize('svn2hg') |
|---|
| 440 | self.failIf(exists(external % '')) |
|---|
| 441 | |
|---|
| 442 | self.tailorize('svn2hg_with_externals') |
|---|
| 443 | self.failUnless(exists(external % '_we')) |
|---|
| 444 | |
|---|
| 445 | def testDarcsRenameDelete(self): |
|---|
| 446 | "Try to migrate a darcs patch that renames and removes the same file" |
|---|
| 447 | |
|---|
| 448 | from os import mkdir |
|---|
| 449 | from os.path import join |
|---|
| 450 | |
|---|
| 451 | drepo = join(self.TESTDIR, 'rename_delete') |
|---|
| 452 | mkdir(drepo) |
|---|
| 453 | |
|---|
| 454 | dinit = ExternalCommand(command=['darcs', 'init'], cwd=drepo) |
|---|
| 455 | dinit.execute() |
|---|
| 456 | |
|---|
| 457 | fileA = join(drepo, 'fileA') |
|---|
| 458 | open(fileA, 'w') |
|---|
| 459 | dadd = ExternalCommand(command=['darcs', 'add'], cwd=drepo) |
|---|
| 460 | dadd.execute(fileA) |
|---|
| 461 | |
|---|
| 462 | drecord = ExternalCommand(command=['darcs', 'record', |
|---|
| 463 | '-a', '-m'], cwd=drepo) |
|---|
| 464 | drecord.execute('Add A') |
|---|
| 465 | |
|---|
| 466 | fileB = join(drepo, 'fileB') |
|---|
| 467 | drename = ExternalCommand(command=['darcs', 'mv'], cwd=drepo) |
|---|
| 468 | drename.execute(fileA, fileB) |
|---|
| 469 | |
|---|
| 470 | dremove = ExternalCommand(command=['darcs', 'remove'], cwd=drepo) |
|---|
| 471 | dremove.execute(fileB) |
|---|
| 472 | |
|---|
| 473 | drecord.execute('Move A to B and delete B') |
|---|
| 474 | |
|---|
| 475 | self.tailorize('darcs_rename_delete') |
|---|
| 476 | |
|---|
| 477 | def testDarcsRenameDeleteDir(self): |
|---|
| 478 | "Test if darcs to svn fails on moves combined with directory deletes" |
|---|
| 479 | |
|---|
| 480 | from os import mkdir |
|---|
| 481 | from os.path import join |
|---|
| 482 | |
|---|
| 483 | drepo = join(self.TESTDIR, 'rename_delete_dir') |
|---|
| 484 | mkdir(drepo) |
|---|
| 485 | |
|---|
| 486 | dinit = ExternalCommand(command=['darcs', 'init'], cwd=drepo) |
|---|
| 487 | dinit.execute() |
|---|
| 488 | |
|---|
| 489 | dir = join(drepo, 'dir') |
|---|
| 490 | mkdir(dir) |
|---|
| 491 | dadd = ExternalCommand(command=['darcs', 'add'], cwd=drepo) |
|---|
| 492 | dadd.execute(dir) |
|---|
| 493 | fileA = join(dir, 'fileA') |
|---|
| 494 | open(fileA, 'w') |
|---|
| 495 | dadd.execute(fileA) |
|---|
| 496 | |
|---|
| 497 | drecord = ExternalCommand(command=['darcs', 'record', |
|---|
| 498 | '-a', '-m'], cwd=drepo) |
|---|
| 499 | drecord.execute('Add dir and dir/A') |
|---|
| 500 | |
|---|
| 501 | fileB = join(drepo, 'fileA') |
|---|
| 502 | drename = ExternalCommand(command=['darcs', 'mv'], cwd=drepo) |
|---|
| 503 | drename.execute(fileA, fileB) |
|---|
| 504 | |
|---|
| 505 | dremove = ExternalCommand(command=['darcs', 'remove'], cwd=drepo) |
|---|
| 506 | dremove.execute(dir) |
|---|
| 507 | |
|---|
| 508 | drecord.execute('Move dir/A to A and delete dir') |
|---|
| 509 | |
|---|
| 510 | self.tailorize('darcs_rename_delete_dir') |
|---|