-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyc

ó
‚F6Pc@@s÷ddlmZddlZddlZddlZddlmZmZddl	m
Z
mZddlm
Z
mZdejfd„ƒYZdefd	„ƒYZd
efd„ƒYZdefd
„ƒYZd„Zdejfd„ƒYZdS(i(tabsolute_importN(tteststosutils(tcolor_stringtFG(tColorFeaturetUnicodeFilenameFeaturetGrepTestBasecB@sleZdZejejBZd„Zed„Z	ddd„Z
ddd„Zd„Zd„Z
d	„ZRS(
sjBase class for testing grep.

    Provides support methods for creating directory and file revisions.
    cC@sd}x0t|ƒD]"}||t|dƒd7}qWt|dƒj|ƒ|r‰|jd|gƒ|jddd|dgƒndS(	Ntis
twtaddtcis-mt"(trangetstrtopentwritetrun_bzr(tselftpathtline_prefixttotal_linest	versionedttextti((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_mk_file+s cC@sDt|dƒj|ƒ|r@|jd|dd|dgƒndS(s*append text to file 'path' and check it intaRs-mRN(RRR(RRRtcheckin((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_update_file5stlinei
cC@s|j|||dtƒdS(NR(RtFalse(RRRR((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_mk_unknown_file;scC@s|j|||dtƒdS(NR(RtTrue(RRRR((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_mk_versioned_file>scC@sKtj|ƒ|rG|jd|gƒ|jddd|dgƒndS(NR
Rs-mR(tostmkdirR(RRR((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_mk_dirAs
cC@s|j|dtƒdS(NR(R$R(RR((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_mk_unknown_dirGscC@s|j|dtƒdS(NR(R$R (RR((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt_mk_versioned_dirJs(t__name__t
__module__t__doc__tret	MULTILINEtDOTALLt_reflagsRR RRR!R$R%R&(((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyR$s	
		tTestGrepcB@seZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d „Z"d!„Z#d"„Z$d#„Z%d$„Z&d%„Z'd&„Z(d'„Z)d(„Z*d)„Z+d*„Z,d+„Z-d,„Z.d-„Z/d.„Z0d/„Z1d0„Z2d1„Z3d2„Z4d3„Z5d4„Z6d5„Z7d6„Z8d7„Z9d8„Z:d9„Z;d:„Z<RS(;sCore functional tests for grep.cC@swd}|j|ƒtj|ƒ|jdƒ|jdddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒdƒ|jdddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒd	ƒ|jddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒd
ƒ|jddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒd
ƒdS(
sZSearch for pattern in specfic file.

        If specified file is unknown, grep it anyway.tfoobar0s	file0.txttgreptline1sfile0.txt:line1tflagsisline\d+i
isline1$N(tmake_branch_and_treeR"tchdirRRtassertContainsReR.R-tassertEqualtlent
splitlinestassertNotContainsRe(Rtwdtoutterr((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_basic_unknown_fileQs 


cC@s<d}|j|ƒtj|ƒ|jdƒ|jdddddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒd	ƒ|jdddd
dgƒ\}}|j|ddtjƒ|jt	|j
ƒƒdƒ|jdddddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒd
ƒdS(s8(versioned) Search for pattern in specfic file.
        R/s	file0.txtR0s-rt1R1sfile0.txt~1:line1R2is
line[0-9]$i	s	line[0-9]i
N(R3R"R4R!RR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_basic_filels


$$$cC@sŸd}|j|ƒtj|ƒ|jdƒ|jdddtƒ|jdddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒd	ƒ|jdd
dgƒ\}}|j|ddtj	ƒ|j
t|jƒƒd	ƒ|jdddddgƒ\}}|j
|ddtj	ƒ|j
t|jƒƒd
ƒ|jdddd
dgƒ\}}|j
|ddtj	ƒ|j
t|jƒƒd
ƒdS(s4(wtree) Search for pattern in specfic file.
        R/s	file0.txtsABC
RR0tABCs
file0.txt:ABCR2is[A-Z]{3}s-rslast:1iN(R3R"R4R!RRRR5R.R-R6R7R8R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_basic_files"


$$c	C@s›d}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jddddd	dd
dgƒ\}}|j|dd
tjƒ|j|dd
tjƒ|j|dd
tjƒ|j	t
|jƒƒdƒ|jddddd	dd
dgƒ\}}|j|dd
tjƒ|j|dd
tjƒ|j|dd
tjƒ|j	t
|jƒƒdƒ|jddddd	dd
dgƒ\}}|j|dd
tjƒ|j|dd
tjƒ|j|dd
tjƒ|j	t
|jƒƒdƒ|jddddd	dd
dgƒ\}}|j|dd
tjƒ|j|dd
tjƒ|j|dd
tjƒ|j	t
|jƒƒdƒdS(s6(versioned) Ensure that -I flag is respected.
        R/sfile0.aasfile0.bbsfile0.ccR0s-rslast:1s	--includes*.aas*.bbR1sfile0.aa~.:line1R2sfile0.bb~.:line1isline1$is-IN(R3R"R4R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_basic_includešs<




cC@sgd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdddddd	gƒ\}}|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒd
ƒ|jddddddgƒ\}}|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒdS(s9(wtree) Ensure that --include flag is respected.
        R/sfile0.aasfile0.bbsfile0.ccR0s	--includes*.aas*.bbR1sfile0.aa:line1R2sfile0.bb:line1isline1$iN(R3R"R4R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_basic_includeÄs$




cC@s'd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jddddd	d
gƒ\}}|j|ddtjƒ|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddd	dgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddd	d
gƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒdS(s=(versioned) Ensure that --exclude flag is respected.
        R/sfile0.aasfile0.bbsfile0.ccR0s-rslast:1s	--excludes*.ccR1sfile0.aa~.:line1$R2sfile0.bb~.:line1$sfile0.aa~.:line10sfile0.bb~.:line10isline1$sfile0.aa~.:line1sfile0.bb~.:line1is-XN(R3R"R4R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_basic_excludeÞs4




cC@s[d}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jddddgƒ\}}|j|d	d
tjƒ|j|dd
tjƒ|j|dd
tjƒ|j	t
|jƒƒdƒ|jdddd
gƒ\}}|j|d	d
tjƒ|j|dd
tjƒ|j|dd
tjƒ|j	t
|jƒƒdƒdS(s9(wtree) Ensure that --exclude flag is respected.
        R/sfile0.aasfile0.bbsfile0.ccR0s	--excludes*.ccR1sfile0.aa:line1R2sfile0.bb:line1islin.1$iN(R3R"R4R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_basic_excludes 




!!cC@sd}|j|ƒtj|ƒ|jdddƒ|jdddƒ|jdddƒ|jddd	d
gƒ\}}|j|ddtjƒ|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|jt	|j
ƒƒdƒ|jddd	dgƒ\}}|j|ddtjƒ|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|jt	|j
ƒƒdƒdS(s:(versioned) Search for pattern in multiple files.
        R/s	file0.txtRis	file1.txts	file2.txtR0s-rslast:1s
line[1-2]$sfile0.txt~.:line1R2sfile0.txt~.:line2sfile1.txt~.:line1sfile1.txt~.:line2sfile2.txt~.:line1sfile2.txt~.:line2iRN(R3R"R4R!RR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_multiple_filess,

!!cC@s×d}|j|ƒtj|ƒ|jdddƒ|jdddƒ|jdddƒ|jdddtƒ|jdddtƒ|jdddtƒ|jd	d
dddgƒ\}}|j|ddt	j
ƒ|j|d
dt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jd	d
dddddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jd	ddddgƒ\}}|j|ddt	j
ƒ|j|d
dt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jd	ddddddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒdS(sF(wtree) Search for pattern in multiple files in working tree.
        R/s	file0.txtRis	file1.txts	file2.txtsHELLO
RR0tHELLOsfile0.txt:HELLOR2sfile1.txt:HELLOsfile2.txt:HELLOis-rslast:1sfile1.txt~.:HELLOisHE..ON(R3R"R4R!RRR RR5R.R-R6R7R8R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_multiple_wtree_files6sB

cC@s“d}|j|ƒtj|ƒ|jdddƒtjddƒ}|jddd	d
dgƒ\}}tjd|jdd
ƒƒ}|j||ƒ|jt	|j
ƒƒdƒ|jddd	ddgƒ\}}tjd|jdd
ƒƒ}|j||ƒ|jt	|j
ƒƒdƒ|jddd	d
dgƒ\}}tjd|jdd
ƒƒ}|j||ƒ|jt	|j
ƒƒdƒdS(sE(versioned) --null option should use NUL instead of newline.
        R/s	file0.txtRiuNFCu6file0.txt~1:line1file0.txt~1:line2file0.txt~1:line3R0s-rslast:1s--nulls	line[1-3]sutf-8tignoreis-ZRN(R3R"R4R!tudt	normalizeRtdecodeR6R7R8(RR:tnrefR;R<tnout((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_null_optioncs"

$$$cC@sd}|j|ƒtj|ƒ|jdddƒ|jdddgƒ\}}|j|dƒ|jt|jƒƒd	ƒ|jdd
dgƒ\}}|j|dƒ|jt|jƒƒd	ƒ|jdd
dgƒ\}}|j|dƒ|jt|jƒƒd	ƒdS(
sA(wtree) --null option should use NUL instead of newline.
        R/s	file0.txtRiR0s--nulls	line[1-3]s0file0.txt:line1file0.txt:line2file0.txt:line3is-ZRN(R3R"R4R!RR6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_null_option|s

cC@sd}|j|ƒtj|ƒ|jdddƒ|jdƒ|jdƒ|jddd	d
dgƒ\}}|j|dd
tjƒ|j	t
|jƒƒdƒ|jddd	d
dgƒ\}}|j|dd
tjƒ|j	t
|jƒƒdƒdS(s2(versioned) Should not recurse with --no-recursiveR/s	fileX.txtRtlintdir0sdir0/file0.txtR0s-rslast:1s--no-recursiveR1sfile0.txt~.:line1R2isline1$N(R3R"R4R!R&RR9R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt'test_versioned_file_in_dir_no_recursives



$$cC@s÷d}|j|ƒtj|ƒ|jdddƒ|jdƒ|jdƒ|jddd	gƒ\}}|j|d
dtjƒ|j	t
|jƒƒdƒ|jddd
gƒ\}}|j|d
dtjƒ|j	t
|jƒƒdƒdS(s.(wtree) Should not recurse with --no-recursiveR/s	fileX.txtRRQRRsdir0/file0.txtR0s--no-recursiveR1sfile0.txt:line1R2islin.1N(R3R"R4R!R&RR9R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt#test_wtree_file_in_dir_no_recursive¡s



cC@sêd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddddgƒ\}}|j|dd	tjƒ|j	t
|jƒƒd
ƒ|jddddgƒ\}}|j|dd	tjƒ|j	t
|jƒƒd
ƒdS(
s/(versioned) Should recurse by default.
        R/RRsdir0/file0.txtR0s-rs-1s.i.e1s^dir0/file0.txt~.:line1R2iR1N(R3R"R4R&R!RR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt"test_versioned_file_in_dir_recurse²s



!!cC@sÞd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddgƒ\}}|j|ddtjƒ|j	t
|jƒƒdƒ|jdd	gƒ\}}|j|ddtjƒ|j	t
|jƒƒdƒd
S(s+(wtree) Should recurse by default.
        R/RRsdir0/file0.txtR0R1s^dir0/file0.txt:line1R2islin.1N(R3R"R4R&R!RR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_file_in_dir_recurseÅs



cC@s÷d}|j|ƒtj|ƒ|jdƒ|jdƒtjdƒ|jddddgƒ\}}|j|dd	tjƒ|j	t
|jƒƒd
ƒ|jddddgƒ\}}|j|dd	tjƒ|j	t
|jƒƒd
ƒdS(
s<(versioned) Search for pattern while in nested dir.
        R/RRsdir0/file0.txtR0s-rslast:1R1s^file0.txt~.:line1R2is.i.e1N(R3R"R4R&R!RR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_versioned_file_within_dirØs




!!cC@sFd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jddƒ|jddƒtjdƒ|jdddd	d
dgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jt|j
ƒƒdƒ|jdddd	d
dgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jt|j
ƒƒdƒ|jdddd	d
dgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jt|j
ƒƒdƒ|jdddd	d
dgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jt|j
ƒƒdƒdS(sH(versioned) Ensure --include is respected with file within dir.
        R/RRsdir0/file0.txts
dir0/file1.aashello
R0s-rslast:1s	--includes*.aaR1s^file1.aa~5:line1$R2s^file1.aa~5:line10$s	file0.txtislast:2..last:1s^file1.aa~4:line1$s^file1.aa~4:line10$islin.1slast:3..last:1s^file1.aa~3:line1$s^file1.aa~3:line10$iN(R3R"R4R&R!RRR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt&test_versioned_include_file_within_dirìsN





cC@sBd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒtjdƒ|jddddd	d
gƒ\}}|j|ddtjƒ|j	|d
dtjƒ|j
t|jƒƒdƒ|jddddd	dgƒ\}}|j|ddtjƒ|j	|d
dtjƒ|j
t|jƒƒdƒdS(sH(versioned) Ensure --exclude is respected with file within dir.
        R/RRsdir0/file0.txts
dir0/file1.aaR0s-rslast:1s	--excludes*.txtR1s^file1.aa~.:line1R2s	file0.txtis	l[a-z]ne1N(
R3R"R4R&R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt&test_versioned_exclude_file_within_dirs"





cC@sëd}|j|ƒtj|ƒ|jdƒ|jdƒtjdƒ|jddgƒ\}}|j|ddtjƒ|j	t
|jƒƒdƒ|jdd	gƒ\}}|j|ddtjƒ|j	t
|jƒƒdƒd
S(s8(wtree) Search for pattern while in nested dir.
        R/RRsdir0/file0.txtR0R1s^file0.txt:line1R2isl[aeiou]ne1N(R3R"R4R&R!RR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_file_within_dir8s




cC@sd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒtjdƒ|jddddgƒ\}}|j|d	d
tjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j|d	d
tjƒ|j|d
d
tjƒ|j	t
|jƒƒdƒdS(sD(wtree) Ensure --include is respected with file within dir.
        R/RRsdir0/file0.txts
dir0/file1.aaR0s	--includes*.aaR1s^file1.aa:line1R2is	l[ixn]ne1s	file0.txtN(
R3R"R4R&R!RR5R.R-R6R7R8R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt"test_wtree_include_file_within_dirLs





!!cC@shd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒtjdƒ|jddddgƒ\}}|j|d	d
tjƒ|j|dd
tjƒ|j	|dd
tjƒ|j
t|jƒƒd
ƒ|jddddgƒ\}}|j|d	d
tjƒ|j|dd
tjƒ|j	|dd
tjƒ|j
t|jƒƒd
ƒdS(sD(wtree) Ensure --exclude is respected with file within dir.
        R/RRsdir0/file0.txts
dir0/file1.aaR0s	--excludes*.txtsli.e1s^file1.aa:line1$R2s^file1.aa:line10$s	file0.txtiR1N(
R3R"R4R&R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt"test_wtree_exclude_file_within_dirbs"





!!c	C@sþd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdd	d
dddd
dgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	|ddtjƒ|j
t|jƒƒdƒ|jdd	d
dddd
dgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	|ddtjƒ|j
t|jƒƒdƒdS(sK(versioned) Ensure --include is respected during recursive search.
        R/RRs
dir0/file0.aatdir1s
dir1/file1.bbtdir2s
dir2/file2.ccR0s-rslast:1s	--includes*.aas*.bbsl..e1s^dir0/file0.aa~.:line1$R2s^dir1/file1.bb~.:line1$s^dir0/file0.aa~.:line10$s^dir1/file1.bb~.:line10$sfile1.cciR1N(
R3R"R4R&R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt'test_versioned_include_from_outside_dir{s2







cC@sòd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdd	d
d	ddgƒ\}}|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	|ddtjƒ|j
t|jƒƒdƒ|jdd	d
d	ddgƒ\}}|j|d
dtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	|ddtjƒ|j
t|jƒƒdƒdS(sG(wtree) Ensure --include is respected during recursive search.
        R/RRs
dir0/file0.aaR]s
dir1/file1.bbR^s
dir2/file2.ccR0s	--includes*.aas*.bbsl.n.1s^dir0/file0.aa:line1$R2s^dir1/file1.bb:line1$s^dir0/file0.aa:line10$s^dir1/file1.bb:line10$sfile1.cciR1N(
R3R"R4R&R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt#test_wtree_include_from_outside_dirŸs2







cC@sVd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdd	d
ddd
gƒ\}}|j|ddtjƒ|j|ddtjƒ|j	|ddtjƒ|jdd	d
dddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j	|ddtjƒdS(sK(versioned) Ensure --exclude is respected during recursive search.
        R/RRs
dir0/file0.aaR]s
dir1/file1.bbR^s
dir2/file2.ccR0s-rslast:1s	--excludes*.ccsl..e1s^dir0/file0.aa~.:line1R2s^dir1/file1.bb~.:line1sfile1.ccR1N(
R3R"R4R&R!RR5R.R-R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt'test_versioned_exclude_from_outside_dirÃs&







cC@sJd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdd	d
dgƒ\}}|j|dd
tjƒ|j|dd
tjƒ|j	|dd
tjƒ|jdd	d
dgƒ\}}|j|dd
tjƒ|j|dd
tjƒ|j	|dd
tjƒdS(sG(wtree) Ensure --exclude is respected during recursive search.
        R/RRs
dir0/file0.aaR]s
dir1/file1.bbR^s
dir2/file2.ccR0s	--excludes*.ccs
l[hijk]ne1s^dir0/file0.aa:line1R2s^dir1/file1.bb:line1sfile1.ccR1N(
R3R"R4R&R!RR5R.R-R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt#test_wtree_exclude_from_outside_dirßs"







!!cC@sþd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jddddgƒ\}}|j|dd	tjƒ|j|d
d	tjƒ|jddddgƒ\}}|j|dd	tjƒ|j|d
d	tjƒdS(
s?(wtree) Grep for pattern with dirs passed as argument.
        R/RRsdir0/file0.txtR]sdir1/file1.txtR0sl[aeiou]ne1s^dir0/file0.txt:line1R2s^dir1/file1.txt:line1R1N(	R3R"R4R&R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt'test_workingtree_files_from_outside_dirùs





!!cC@s
d}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdddd	ddgƒ\}}|j|d
dtjƒ|j|ddtjƒ|jdddd
ddgƒ\}}|j|d
dtjƒ|j|ddtjƒdS(sC(versioned) Grep for pattern with dirs passed as argument.
        R/RRsdir0/file0.txtR]sdir1/file1.txtR0s-rslast:1s.ine1s^dir0/file0.txt~.:line1R2s^dir1/file1.txt~.:line1R1N(	R3R"R4R&R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt%test_versioned_files_from_outside_dirs





''cC@sþd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jddddgƒ\}}|j|dd	tjƒ|j|d
d	tjƒ|jddddgƒ\}}|j|dd	tjƒ|j|d
d	tjƒdS(
s?(wtree) Grep for pattern with dirs passed as argument.
        R/RRsdir0/file0.txtR]sdir1/file1.txtR0sli.e1s^dir0/file0.txt:line1R2s^dir1/file1.txt:line1R1N(	R3R"R4R&R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt!test_wtree_files_from_outside_dir#s





!!cC@s`d}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdd	d
ddgƒ\}}|j|dd
tjƒ|jdd	d
dgƒ\}}|j|dd
tjƒ|jdd	d
ddgƒ\}}|j|dd
tjƒ|jdd	d
dgƒ\}}|j|dd
tjƒdS(sD(versioned) Grep for pattern with two levels of nested dir.
        R/RRsdir0/file0.txtR]sdir1/file1.txts
dir0/dir00sdir0/dir00/file0.txtR0s-rslast:1sl.ne1s^dir0/dir00/file0.txt~.:line1R2R1N(	R3R"R4R&R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt*test_versioned_files_from_outside_two_dirs8s"







$!$!cC@sHd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdƒ|jdd	dgƒ\}}|j|d
dtjƒ|jddgƒ\}}|j|d
dtjƒ|jdd
dgƒ\}}|j|d
dtjƒ|jdd
gƒ\}}|j|d
dtjƒdS(s@(wtree) Grep for pattern with two levels of nested dir.
        R/RRsdir0/file0.txtR]sdir1/file1.txts
dir0/dir00sdir0/dir00/file0.txtR0slin.1s^dir0/dir00/file0.txt:line1R2sli.e1R1N(	R3R"R4R&R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt&test_wtree_files_from_outside_two_dirsTs"







cC@sÜd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒtjdƒ|jddddgƒ\}}|j|d	d
tjƒ|jdddddgƒ\}}|j|d
d
tjƒ|jdddddgƒ\}}|j	|dd
tjƒ|jddddgƒ\}}|j|d	d
tjƒ|jdddddgƒ\}}|j|d
d
tjƒ|jdddddgƒ\}}|j	|dd
tjƒ|j
t|jƒƒdƒdS(sI(versioned) Search for pattern while in nested dir (two levels).
        R/RRs	dir0/dir1sdir0/dir1/file0.txtR0s-rslast:1s.ine1s^dir1/file0.txt~.:line1R2s--from-rootsl.ne1s^dir0/dir1/file0.txt~.:line1s--no-recursiveR1s	file0.txtslin.1iN(
R3R"R4R&R!RR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt)test_versioned_file_within_dir_two_levelsps(





!$$!$$cC@sœd}|j|ƒtj|ƒ|jdƒ|jdƒ|jdƒtjdƒ|jddgƒ\}}|j|ddtjƒ|jdd	d
gƒ\}}|j|ddtjƒ|jddd
gƒ\}}|j	|ddtjƒ|jddgƒ\}}|j|ddtjƒ|jdd	dgƒ\}}|j|ddtjƒ|jdddgƒ\}}|j	|ddtjƒdS(sE(wtree) Search for pattern while in nested dir (two levels).
        R/RRs	dir0/dir1sdir0/dir1/file0.txtR0s	l[hij]ne1s^dir1/file0.txt:line1R2s--from-rootsl.ne1s^dir0/dir1/file0.txt:line1s--no-recursiveslin.1s	file0.txtR1N(
R3R"R4R&R!RR5R.R-R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt%test_wtree_file_within_dir_two_levelsŽs&





cC@s«d}|j|ƒtj|ƒ|jdƒ|jdddddgƒ\}}|j|ddtjƒ|jdddd	dgƒ\}}|j|ddtjƒd
S(s7(versioned) Match fails without --ignore-case.
        R/s	file0.txtR0s-rslast:1tLinE1sfile0.txt~.:line1R2sLi.E1N(R3R"R4R!RR9R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt#test_versioned_ignore_case_no_match«s


$$cC@sŸd}|j|ƒtj|ƒ|jdƒ|jdddgƒ\}}|j|ddtjƒ|jdddgƒ\}}|j|ddtjƒdS(	s3(wtree) Match fails without --ignore-case.
        R/s	file0.txtR0Rjsfile0.txt:line1R2s.inE1N(R3R"R4R!RR9R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_ignore_case_no_match¹s


cC@sñd}|j|ƒtj|ƒ|jdƒ|jddddddgƒ\}}|j|dd	tjƒ|jddddd
dgƒ\}}|j|dd	tjƒ|jddddd
dgƒ\}}|j|dd	tjƒd
S(s7(versioned) Match fails without --ignore-case.
        R/s	file0.txtR0s-rslast:1s-isLi.E1sfile0.txt~.:line1R2Rjs
--ignore-cases^file0.txt~.:line1N(R3R"R4R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt test_versioned_ignore_case_matchÇs


cC@sßd}|j|ƒtj|ƒ|jdƒ|jddddgƒ\}}|j|ddtjƒ|jddddgƒ\}}|j|d	dtjƒ|jddd
dgƒ\}}|j|d	dtjƒdS(s3(wtree) Match fails without --ignore-case.
        R/s	file0.txtR0s-iRjsfile0.txt:line1R2s
--ignore-cases^file0.txt:line1sLi.E1N(R3R"R4R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_ignore_case_matchÛs


!!!cC@s¿d}|j|ƒtj|ƒ|jdƒ|jdƒtjdƒ|jddddgƒ\}}|j|ddtjƒ|jdddd	gƒ\}}|j|ddtjƒd
S(s;(versioned) Match should fail without --from-root.
        R/s	file0.txtRRR0s-rslast:1sli.e1R2R1N(	R3R"R4R!R&RR9R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_versioned_from_root_failìs




!!cC@s³d}|j|ƒtj|ƒ|jdƒ|jdƒtjdƒ|jddgƒ\}}|j|ddtjƒ|jddgƒ\}}|j|ddtjƒdS(	s7(wtree) Match should fail without --from-root.
        R/s	file0.txtRRR0R1R2sli.e1N(	R3R"R4R!R&RR9R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_from_root_failüs




cC@sÅd}|j|ƒtj|ƒ|jdƒ|jdƒtjdƒ|jdddddgƒ\}}|j|d	d
tjƒ|jdddddgƒ\}}|j|d	d
tjƒdS(
s1(versioned) Match pass with --from-root.
        R/s	file0.txtRRR0s-rslast:1s--from-rootsl.ne1sfile0.txt~.:line1R2R1N(	R3R"R4R!R&RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_versioned_from_root_passs




cC@s¹d}|j|ƒtj|ƒ|jdƒ|jdƒtjdƒ|jdddgƒ\}}|j|ddtjƒ|jddd	gƒ\}}|j|ddtjƒd
S(s-(wtree) Match pass with --from-root.
        R/s	file0.txtRRR0s--from-rootslin.1sfile0.txt:line1R2R1N(	R3R"R4R!R&RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_from_root_passs




cC@s+d}|j|ƒtj|ƒ|jdƒ|jddddddgƒ\}}|j|dd	tjƒ|jddddd
dgƒ\}}|j|dd	tjƒ|jddddddgƒ\}}|j|d
d	tjƒ|jddddgƒ\}}|j|dd	tjƒdS(s;(versioned) Search for pattern with --line-number.
        R/s	file0.txtR0s-rslast:1s
--line-numbersli.e3sfile0.txt~.:3:line3R2tline3s-nR1sfile0.txt~.:1:line1s	line[0-9]sfile0.txt:3:line3N(R3R"R4R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_versioned_with_line_number.s


!cC@sd}|j|ƒtj|ƒ|jdƒ|jddddgƒ\}}|j|ddtjƒ|jddd	dgƒ\}}|j|d
dtjƒ|jddddgƒ\}}|j|d
dtjƒ|jddddgƒ\}}|j|ddtjƒd
S(s7(wtree) Search for pattern with --line-number.
        R/s	file0.txtR0s
--line-numberRssfile0.txt:3:line3R2s-nR1sfile0.txt:1:line1s
[hjkl]ine1s	line[0-9]N(R3R"R4R!RR5R.R-(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_with_line_numberEs


!!!!cC@sêd}d}|j|ƒtj|ƒ|j|ddƒ|j|ddƒ|j|ddƒ|j|ddƒ|jd	d
dd|gƒ\}}|j|dd
tjƒ|jd	d
dd|gƒ\}}|j	|dd
tjƒ|jd	d
ddd|gƒ\}}|j	|dd
tjƒ|jd	d
dd|gƒ\}}|j|dd
tjƒ|jd	d
dd|gƒ\}}|j	|dd
tjƒ|jd	d
ddd|gƒ\}}|j	|dd
tjƒdS(sBSearch for pattern in specific revision number in a file.
        R/s	file0.txtRiRsv2 text
sv3 text
sv4 text
R0s-rt2tv3R2t3sfile0.txt~3:v3.*s-nsfile0.txt~3:2:v3.*s[tuv]3N(
R3R"R4R!RRR9R.R-R5(RR:tfnameR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt"test_revno_basic_history_grep_fileYs(

$$'$$'cC@såd}d}|j|ƒtj|ƒ|j|ddƒ|jdƒ|j|ddƒ|j|ddƒ|j|dd	ƒ|jd
ddd
gƒ\}}|j|ddtjƒ|jd
ddd
gƒ\}}|j	|ddtjƒ|jd
dddd
gƒ\}}|j	|ddtjƒ|jd
dddgƒ\}}|j|ddtjƒ|jd
dddgƒ\}}|j	|ddtjƒ|jd
ddddgƒ\}}|j	|ddtjƒdS(sBSearch for pattern in specific revision number in a file.
        R/s	file0.txtRis	file1.txtRsv3 text
sv4 text
sv5 text
R0s-rRvRwR2Rxsfile0.txt~3:v3s-nsfile0.txt~3:1:v3s[tuv]3N(
R3R"R4R!RRR9R.R-R5(RR:RyR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt"test_revno_basic_history_grep_full}s*


!!$!!$cC@sVd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddƒ|jddƒ|jddƒ|jddd	d
gƒ\}}|j|ddtj	ƒ|jddd
d
gƒ\}}|j
|ddtj	ƒ|jddd	dgƒ\}}|j|ddtj	ƒ|jddd
dgƒ\}}|j
|ddtj	ƒdS(s3Grep specific version of file withing dir.
        R/RRsdir0/file0.txtsv3 text
sv4 text
sv5 text
R0s-rslast:3tv4s^dir0/file0.txtR2slast:2s^dir0/file0.txt~4:v4s[tuv]4N(R3R"R4R&R!RRR9R.R-R5(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt test_revno_versioned_file_in_dir¢s 



!!!!cC@sÛd}d}|j|ƒtj|ƒ|j|ddƒ|jdƒ|j|ddƒ|j|ddƒ|j|dd	ƒ|j|dd
ƒ|jddd
dgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j	t
|jƒƒdƒ|jddddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddd
dgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒ|jddddgƒ\}}|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j|ddtjƒ|j	t
|jƒƒdƒdS(s7Search for pattern in revision range for file.
        R/s	file0.txtRis	file1.txtRsv3 text
sv4 text
sv5 text
sv6 text
R0s-rs1..Rwsfile0.txt~3:v3R2sfile0.txt~4:v3sfile0.txt~5:v3sfile0.txt~6:v3is..1s..6s..s1..5is5..1s[tuv]3N(
R3R"R4R!RRR5R.R-R6R7R8R9(RR:RyR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt#test_revno_range_basic_history_grep¾sx


!!!!!!!!!cC@sÀd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddƒ|jddƒ|jddƒ|jddƒ|jdd	d
dgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jt|j
ƒƒdƒ|jdd	d
dgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jt|j
ƒƒdƒdS(s;Grep rev-range for pattern for file withing a dir.
        R/RRsdir0/file0.txtsv3 text
sv4 text
sv5 text
sv6 text
R0s-rs2..5Rws^dir0/file0.txt~3:v3R2s^dir0/file0.txt~4:v3s^dir0/file0.txt~5:v3s^dir0/file0.txt~6:v3is[tuv]3N(R3R"R4R&R!RRR5R.R-R9R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt&test_revno_range_versioned_file_in_dirs*



!!cC@sŽd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddƒ|jddƒ|jddƒ|jddƒ|jdd	d
ddgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒ|jdd	d
ddgƒ\}}|j|dd
tj	ƒ|j|dd
tj	ƒ|j|dd
tj	ƒ|j
|dd
tj	ƒdS(s5Grep rev-range for pattern from outside dir.
        R/RRsdir0/file0.txtsv3 text
sv4 text
sv5 text
sv6 text
R0s-rs2..5Rws^dir0/file0.txt~3:v3R2s^dir0/file0.txt~4:v3s^dir0/file0.txt~5:v3s^dir0/file0.txt~6:v3s[tuv]3N(R3R"R4R&R!RRR5R.R-R9(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt0test_revno_range_versioned_file_from_outside_dir#s&



$$cC@s	d}d}|j|ƒtj|ƒ|jdƒtjdƒ|jd||gƒ\}}tj|ƒ|jdƒtjtjd|ƒƒ|jdtjd|ƒgƒ\}}|jdd	d
gƒ\}}|jddgƒ\}}|j|d
dtj	ƒ|j|ddtj	ƒ|jdddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jdddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒd ƒ|jddd!d"ddgƒ\}}|j|d#dtj	ƒ|j|d$dtj	ƒ|j|d%dtj	ƒ|j|d&dtj	ƒ|j|d'dtj	ƒ|j|d(dtj	ƒ|j|d)dtj	ƒ|j|d*dtj	ƒ|j
t|jƒƒd ƒ|jddd+gƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jddddd,gƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒd ƒ|jddd!d"dd-gƒ\}}|j|d.dtj	ƒ|j|d/dtj	ƒ|j|d0dtj	ƒ|j|d1dtj	ƒd2S(3s>--levels=0 should show findings from merged revision.
        R/tfoobar1s	file0.txts..tbranchs	file1.txttmergeRs-mtmergedR0R1sfile0.txt:line1R2sfile1.txt:line1s
--levels=0s^file0.txt:line1$s^file1.txt:line1$s^file0.txt:line10$s^file1.txt:line10$is-rslast:1..s^file0.txt~2:line1$s^file1.txt~2:line1$s^file0.txt~1.1.1:line1$s^file1.txt~1.1.1:line1$s^file0.txt~2:line10$s^file1.txt~2:line10$s^file0.txt~1.1.1:line10$s^file1.txt~1.1.1:line10$is-1..s-ns^file0.txt~2:1:line1$s^file1.txt~2:1:line1$s^file0.txt~1.1.1:1:line1$s^file1.txt~1.1.1:1:line1$s^file0.txt~2:10:line10$s^file1.txt~2:10:line10$s^file0.txt~1.1.1:10:line10$s^file1.txt~1.1.1:10:line10$sl.ne1slin.1s.ine1sfile0.txt~2:1:line1sfile1.txt~2:1:line1sfile0.txt~1.1.1:1:line1sfile1.txt~1.1.1:1:line1N(
R3R"R4R!RRtpathjoinR5R.R-R6R7R8(Rtwd0twd1R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_levels<s|





'$'$'cC@sÝd}d}|j|ƒtj|ƒ|jdƒtjdƒ|jd||gƒ\}}tj|ƒ|jdƒ|jddƒ|jddƒ|jdd	ƒtjtjd|ƒƒ|jd
tjd|ƒgƒ\}}|jddd
gƒ\}}|jddddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|j|ddt	j
ƒ|j|ddt	j
ƒ|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒdS(sGrep in dotted revs
        R/Rs	file0.txts..R‚s	file1.txtstext 0
stext 1
stext 2
RƒRs-mR„R0s-rs1.1.1..1.1.4Rsfile1.txt~1.1.2:text 0R2sfile1.txt~1.1.3:text 1sfile1.txt~1.1.4:text 0sfile1.txt~1.1.4:text 1sfile1.txt~1.1.4:text 2iN(R3R"R4R!RRRR…R5R.R-R6R7R8(RR†R‡R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_dotted_rev_grepŠs.





'!cC@spd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddƒ|jddddd	dgƒ\}}|j|dd
tjƒ|j	|dd
tjƒ|j
t|jƒƒdƒ|j
t|jƒƒd
ƒ|jddddddgƒ\}}|j|dd
tjƒ|j	|dd
tjƒ|j
t|jƒƒdƒ|j
t|jƒƒd
ƒdS(s5(versioned) Grep for pattern in binary file.
        R/sfile.txts	file0.bint	lineNN
R0s-vs-rslast:1tlineNNR2sBinary file.*file0.bin.*skippediisline.NN(
R3R"R4R!RRR9R.R-R5R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_versioned_binary_file_grep©s$



cC@säd}|j|ƒtj|ƒ|jdƒ|jddƒ|jddddgƒ\}}|j|ddtjƒ|j	|d	dtjƒ|jdddgƒ\}}|j|ddtjƒ|j|d
dtjƒdS(s1(wtree) Grep for pattern in binary file.
        R/s	file0.binRŠR0s-vR‹sfile0.bin:line1R2sBinary file.*file0.bin.*skippedsBinary fileN(
R3R"R4R!RRR9R.R-R5(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_binary_file_grepÂs


!cC@sÆd}|j|ƒtj|ƒ|jdƒ|jdƒ|jddƒ|jddƒ|jddƒ|jddd	d
gƒ\}}|j|ddtj	ƒ|j
t|jƒƒd
ƒ|jddddgƒ\}}|j
|ddtj	ƒ|j
t|jƒƒdƒ|jddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒd
ƒ|jdddd
gƒ\}}|j
|ddtj	ƒ|j
t|jƒƒdƒdS(s%Ensure various revspecs work
        R/RRsdir0/file0.txtsv3 text
sv4 text
sv5 text
R0s-rs
revno:1..2Rwtfile0R2is	revno:4..R|s^dir0/file0.txtis	..revno:3iN(R3R"R4R&R!RRR9R.R-R6R7R8R5(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_revspecÕs(



!!!!cC@scd}|j|ƒtj|ƒ|jdddƒ|jdddƒ|jdƒ|jdddƒ|jdddƒ|jdd	d
tƒ|jdd	d
tƒ|jddd
gƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddd
gƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddd
ddgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddddgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddd
dgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddddgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddd
gƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddddgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒdS(s6(wtree) Ensure --files-with-matches, -l works
        R/s	file0.txtRis	file1.txtRRsdir0/file00.txtsdir0/file01.txtsHELLO
RR0s--files-with-matchesRGs^file0.txt$R2s^dir0/file00.txt$sHE.LOs-lis.ELLOs--no-recursiveN(R3R"R4R!R&RRRR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_files_with_matchesñsX


$$!!!!cC@s©d}|j|ƒtj|ƒ|jdddƒ|jdddƒ|jdƒ|jdddƒ|jdddƒ|jdd	ƒ|jdd	ƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒdS(s4(ver) Ensure --files-with-matches, -l works
        R/s	file0.txtRis	file1.txtRRsdir0/file00.txtsdir0/file01.txtsHELLO
R0s-rs-1s--files-with-matchesRGs
^file0.txt~7$R2s^dir0/file00.txt~7$sH.LLOs6..7s
^file0.txt~6$is-lis-2sHE.LOs--no-recursives.ELLON(
R3R"R4R!R&RRR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_files_with_matchesAs€


$$cC@s•d}|j|ƒtj|ƒ|jdddƒ|jdddƒ|jdƒ|jdddƒ|jdddƒ|jdd	d
tƒ|jdd	d
tƒ|jddd
gƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddd
gƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddd
ddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddddgƒ\}}|j|ddt	j
ƒ|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddd
dgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddddgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jdddd
gƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒ|jddddgƒ\}}|j|ddt	j
ƒ|jt|j
ƒƒdƒdS(s7(wtree) Ensure --files-without-match, -L works
        R/s	file0.txtRis	file1.txtRRsdir0/file00.txtsdir0/file01.txtsHELLO
RR0s--files-without-matchRGs^file1.txt$R2s^dir0/file01.txt$sHE.LOs-Ls.ELLOis--no-recursiveN(R3R"R4R!R&RRRR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt test_wtree_files_without_matches«s\


$$!!!!cC@s?d}|j|ƒtj|ƒ|jdddƒ|jdddƒ|jdƒ|jdddƒ|jdddƒ|jdd	ƒ|jdd	ƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddd
dgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
ddddddgƒ\}}|j|ddtj	ƒ|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒ|jd
dddddgƒ\}}|j|ddtj	ƒ|j
t|jƒƒdƒdS(s5(ver) Ensure --files-without-match, -L works
        R/s	file0.txtRis	file1.txtRRsdir0/file00.txtsdir0/file01.txtsHELLO
R0s-rs-1s--files-without-matchRGs
^file1.txt~7$R2s^dir0/file01.txt~7$sH.LLOs6..7s
^file1.txt~6$s^dir0/file00.txt~6$s^dir0/file01.txt~6$is-Ls-2isHE.LOs--no-recursives.ELLON(
R3R"R4R!R&RRR5R.R-R6R7R8(RR:R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_files_without_matchesýsŒ


$$cC@sd}d}|j|ƒtj|ƒ|jdƒtjdƒ|jdd||gƒ\}}tj|ƒ|jddgd	ƒ\}}|j|d
dtjƒ|j|dƒ|jdd
ddgƒ\}}|j|ddtjƒ|jt	|j
ƒƒdƒdS(s0Ensure grep works without working tree.
        R/Rs	file0.txts..R‚s	--no-treeR0R1isCannot search working treeR2Rs-rR>sfile0.txt~1:line1iN(R3R"R4R!RR5R.R-R6R7R8(RR†R‡R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_no_treems



!
!(=R'R(R)R=R?RARBRCRDRERFRHRORPRSRTRURVRWRXRYRZR[R\R_R`RaRbRcRdReRfRgRhRiRkRlRmRnRoRpRqRrRtRuRzR{R}R~RR€RˆR‰RŒRRRR‘R’R“R”(((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyR.Nsv				*		$			-								3					$	$																				$	%		J			N					P	j	R	ptTestNonAsciicB@s eZdZegZd„ZRS(s/Tests for non-ascii filenames and file contentscC@sq|jdƒ}dg}|j|ƒ|j|ƒ|jdƒdjdƒ}|jdddgddƒ}|j||d	d
fƒ|jdddddgddƒ}|j||d
d
fƒtjƒ}|j	|dƒjdƒ}|jdddgddƒ}|j|d||fd
fƒ|jdddddgddƒ}|j|d||fd
fƒdS(s;Test filename and contents that requires a unicode encodingt.uሴsInitial commitsUTF-8R0s--files-with-matchesucontentstencodings
Rs-rR>s~1
treplaces-ns%s:1:contents of %s
s%s~1:1:contents of %s
N(
R3t
build_treeR
tcommittencodeRR6Rtget_user_encodingRL(Rttreetcontentstas_utf8tstreamstfileencodingt
as_mangled((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_unicode_only_file‡s,	


(R'R(R)Rt_test_needs_featuresR£(((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyR•‚s	t
TestColorGrepcB@sneZdZegZeddejƒZeddej	ƒZ
d„Zd„Zd„Z
d„Zd„ZRS(	sTests for the --color option.t~tfgt:cC@sQ|jddddgdƒ\}}|j|dƒ|j|ddtjƒd	S(
s,Ensure options for color are valid.
        R0s--colortfootbariRsValid values for --color areR2N(RR6R5R.R-(RR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_color_option±s$cC@sù|jdƒ}dddg}|j|ƒ|j|ƒ|jdƒ|jdddd	d
ddgƒ}|j|d
jtjd|j	d
dgƒd
fƒ|jdddd	d
ddgƒ}|j|d
jtjd|j	d
dgƒd
fƒdS(s1(versioned) Search for matches or no matches onlyR–sd/sd/aaatbbbsInitial commitR0s--colortalwayss-rR>s--files-with-matchestaaaRs
s--files-without-matchN(
R3R™R
RšRR6tjoinRtMAGENTAt_rev_sep(RRRžR ((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_ver_matching_files¸s



cC@sç|jdƒ}dddg}|j|ƒ|j|ƒ|jdƒ|jdddd	d
gƒ}|j|djtjdtj	dgƒdfƒ|jdddd
d
gƒ}|j|djtjdtj	dgƒdfƒdS(s-(wtree) Search for matches or no matches onlyR–sd/sd/aaaR¬sInitial commitR0s--colorR­s--files-with-matchesR®Rs
s--files-without-matchN(
R3R™R
RšRR6R¯RR°tNONE(RRRžR ((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_wtree_matching_filesÎs



c		C@sÒd}|j|ƒtj|ƒd}|jdd|ddƒtddtjƒ}tjd|jd	|j	|d
|dd}d
}tjd|jd	|j	d	|j	|d
|dd}|j
ddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
ddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
dddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
ddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
dddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
dddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
ddddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
dddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒ|j
ddddddd	dgƒ\}}|j||ƒ|jt|j
ƒƒdƒdS(s8(versioned) Search for pattern in specfic file.
        R/s
foo is foobars	file0.txtRRiR©R§R>s is tbar1s
sfile0.txt~1:foo is foobar1
R0s--colorR­s-rtautos-itFOOsf.osF.Os-nN(R3R"R4R!RRtBOLD_REDR°R±t_sepRR6R7R8(	RR:tlpR©tresttxt_restnresR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyR?äsZ

3>cC@s3d}|j|ƒtj|ƒd}|jdd|ddƒtddtjƒ}tjd|j|d	|d
d}tjd|jd|j|d	|d
d}|j	d
dddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
ddddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
dddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
ddddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
ddddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
dddddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
ddddgƒ\}}|j
||ƒ|j
t|jƒƒdƒ|j	d
dddddgƒ\}}|j
||ƒ|j
t|jƒƒdƒdS(s4(wtree) Search for pattern in specfic file.
        R/s
foo is foobars	file0.txtRRiR©R§s is Rµs
R>R0s--colorR­s-iR·sf.osF.Os-nN(
R3R"R4R!RRR¸R°R¹RR6R7R8(RR:RºR©R»R½R;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyRA'sP

(3(R'R(R)RR¤RRtBOLD_YELLOWR±t	BOLD_CYANR¹R«R²R´R?RA(((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyR¥¨s					CcC@stjdd|ƒS(s*Replace date strings with constant values.s.\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} [-\+]\d{4}sYYYY-MM-DD HH:MM:SS +ZZZZ(R*tsub(tstring((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pytsubst_datescs	tTestGrepDiffcB@s>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cC@s`|jdƒ}|jddgƒ|jdgƒ|jdƒ|jdgƒ|jdƒ|S(	NR–thellosfoo
tgoodbyesbaz
tsetup(RÄsfoo
(RÅsbaz
(R3tbuild_tree_contentsR
Rš(RR((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pytmake_example_branchks


cC@sq|jƒ}|jd	gƒ|jdƒ|jdddgƒ\}}|j|dƒ|jt|ƒdƒdS(
sgrep -p basic test.RÄs
hello world!
s
updated helloR0s-pRs=== revno:3 ===
  === modified file 'hello'
    --- hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +++ hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +hello world!
=== revno:1 ===
  === added file 'hello'
    --- hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +++ hello	YYYY-MM-DD HH:MM:SS +ZZZZ
N(shellos
hello world!
(RÈRÇRšRtassertEqualstassertEqualDiffRÂ(RRR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_grep_diff_basicvs

cC@sw|jƒ}|jdgƒ|jdƒ|jdddddgƒ\}}|j|dƒ|jt|ƒd	ƒd
S(sgrep -p specific revision.RÄs
hello world!
s
updated helloR0s-ps-rRxRsŽ=== revno:3 ===
  === modified file 'hello'
    --- hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +++ hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +hello world!
N(shellos
hello world!
(RÈRÇRšRRÉRÊRÂ(RRR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_grep_diff_revision‰s
$cC@sÄ|jƒ}|jdgƒ|jdƒ|jdgƒ|jdƒ|jdƒtddƒjdƒ|jd	ƒ|jd
ddd
dgƒ\}}|j|dƒ|jt	|ƒdƒdS(sgrep -p revision range.RÄshello world!1
trev3tblahshello world!2
trev4Rshello world!3
trev5R0s-ps-rs2..5RsY=== revno:5 ===
  === modified file 'hello'
    --- hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +++ hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +hello world!3
=== revno:4 ===
  === added file 'blah'
    +hello world!2
=== revno:3 ===
  === modified file 'hello'
    --- hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +++ hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +hello world!1
N(shelloshello world!1
(RÎshello world!2
(
RÈRÇRšR
RRRRÉRÊRÂ(RRR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_grep_diff_revision_range˜s



$cC@sä|jƒ}|jdgƒ|jdƒ|jdddddd	dgƒ\}}|j|d
ƒtddtjƒd
}tddtjƒd
}tddtj	ƒ}d}|j
d|ƒ}|jt|ƒ|||ƒdS(sgrep -p color test.RÄs
hello world!
s
updated helloR0s--diffs-rRxs--colorR­Rs=== revno:3 ===R§s
s  === modified file 'hello'sb    --- hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +++ hello	YYYY-MM-DD HH:MM:SS +ZZZZ
    +hello world!
N(shellos
hello world!
(
RÈRÇRšRRÉRRt	BOLD_BLUEtBOLD_MAGENTAR¸R˜RÊRÂ(RRR;R<trevnotfilenametredhellotdiffstr((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_grep_diff_colorµs
cC@s]|jdgƒ\}}|jdddgdƒ\}}|j|dƒ|j|dƒdS(	sgrep -p with zero revisions.tinitR0s--diffR©iRs+ERROR:.*revision.* does not exist in branchN(RRÉR5(RR;R<((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyttest_grep_norevsÈs!(R'R(RÈRËRÌRÑRØRÚ(((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyRÃis					(t
__future__RR"R*tunicodedataRJtbzrlibRRtbzrlib._termcolorRRtbzrlib.tests.featuresRRtTestCaseWithTransportRR.R•R¥RÂRÃ(((sA/usr/lib/python2.7/dist-packages/bzrlib/plugins/grep/test_grep.pyt<module>s&
*ÿÿÿÿÿÿÿ;&»	

Copyright © 2017 || Recoded By Mr.Bumblebee