[Bug 425510] Re: 'bzr mv' should do wildcard expansion on windows

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri Sep 11 13:18:54 BST 2009


>>>>> "Maritza" == Maritza Mendez <martitzam at gmail.com> writes:

<snip/>

<blush> Sorry, I didn't realize you had put that in the bug
reports already.

Anyway, you slightly edited them below, which is interesting with
regard to how we want to handle the shell-like scripts:

    bug> C:\>mkdir t
    bug> C:\>cd t
    bug> C:\t>bzr init
    bug> Created a standalone tree (format: pack-0.92)
    bug> C:\t>echo > cat.txt
    bug> C:\t>echo > dog.txt
    bug> C:\t>mkdir pets
    bug> C:\t>bzr add *.txt
    bug> adding cat.txt
    bug> adding dog.txt
    bug> C:\t>bzr add pets
    bug> adding pets
    bug> C:\t>bzr mv *.txt .\pets
    bug> bzr: ERROR: Could not move *.txt => pets: *.txt is not versioned.

    mail> # test for 'bzr mv' [Bug 425510]
    mail> mkdir t
    mail> cd t
    mail> bzr init
    mail> echo > cat.txt
    mail> echo > dog.txt
    mail> bzr add *.txt
    mail> bzr mkdir pets
    mail> bzr mv *.txt .\pets

pslt == proposed shell-like tests:

    pslt> class TestMaritza(script.TestCaseWithTransportAndScript):

    pslt>     def test_425510_mv(self):
    pslt>         story = """
    pslt> mkdir t
    pslt> cd t
    pslt> bzr init
    pslt> echo > cat.txt
    pslt> echo > dog.txt
    pslt> bzr add cat.txt dog.txt
    pslt> bzr mkdir pets
    pslt> bzr mv *.txt pets
    pslt> """
    pslt>         self.run_script(story)

gives:

AssertionError: In <bzr mv *.txt pets>, unexpected error: bzr: ERROR: Could not move *.txt => pets: *.txt is not versioned.


    bug> C:>mkdir t
    bug> C:>cd t
    bug> C:\t>bzr init
    bug> Created a standalone tree (format: pack-0.92)
    bug> C:\t>echo > cat.txt
    bug> C:\t>echo > bat.txt
    bug> C:\t>bzr add
    bug> adding bat.txt
    bug> adding cat.txt
    bug> C:\t>bzr commit -m "import" Committing to: C:/t/ added bat.txt added cat.txt Committed revision 1.
    bug> C:\t>bzr rm *.txt
    bug> bzr: ERROR: [Error 123] The filename, directory name, or volume label syntax is incorrect: u'C:/t/*.txt\\*.*'


    mail> #test for 'bzr rm' [Bug 426410]
    mail> mkdir t
    mail> cd t
    mail> bzr init
    mail> echo > cat.txt
    mail> echo > dog.txt
    mail> bzr add *.txt
    mail> bzr rm *.txt

    pslt>     def test_426410_rm(self):
    pslt>         story = """
    pslt> mkdir t
    pslt> cd t
    pslt> bzr init
    pslt> echo > cat.txt
    pslt> echo > dog.txt
    pslt> bzr add cat.txt dog.txt
    pslt> bzr rm --force *.txt
    pslt> 2>deleted dog.txt
    pslt> 2>deleted cat.txt
    pslt> """
    pslt>         self.run_script(story)

gives:

AssertionError: texts not equal:
+ *.txt does not exist.
- deleted dog.txt
- deleted cat.txt


The version I used to run the example above is only slightly
different than the one waiting review (hint, hint, nudge :-).

I cheated a little because the shell-like tests didn't handle
glob so far (haha aren't life funny ?) and I had to fix a bug too
('> cat.txt' wasn't handled as '>cat.txt').

But both tests are failing right now and for the right cause: no
glob handling at the shell level.

Also note that except for your prompts, you can specify the
expected outputs or errors exactly as they appear in your initial
report.

Thoughts ?

          Vincent

P.S.: The updated branch is at lp:~vila/bzr/shell-like-tests
P.P.S.: Will look into that glob handling for the tests now.



More information about the bazaar mailing list