`brz add` in git format doesn't report files added

Bug #1799482 reported by Brian de Alwis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Breezy
Fix Released
High
Brian de Alwis

Bug Description

Version: brz at HEAD (`brz version` = `3.0a1`)

Steps to repeat:
```
$ brz init --format git foo
$ cd foo
$ mkdir a b
$ echo a > a/file.txt
$ echo b > b/file.txt
$ brz add a b
adding a
adding b
adding b
adding b
```

I expected to see:
```
$ brz add a b
adding a
adding b
adding a/file.txt
adding b/file.txt
```

It looks like the culprit is `breezy/git/workingtree.py(504)smart_add()` where it should be using `call_action(subp, kind)`
```
-> call_action(filepath, kind)
(Pdb) l
499 if subpath in index:
500 # Already present
501 continue
502 if subp in conflicts_related:
503 continue
504 -> call_action(filepath, kind)
505 if save:
506 self._index_add_entry(subp, kind)
507 added.append(subp)
508 return added, ignored
509
```

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 1799482] [NEW] `brz add` in git format doesn't report files added

On Tue, Oct 23, 2018 at 02:35:38PM -0000, Brian de Alwis wrote:
> Public bug reported:
>
> Version: brz at HEAD (`brz version` = `3.0a1`)
>
> Steps to repeat:
> ```
> $ brz init --format git foo
> $ cd foo
> $ mkdir a b
> $ echo a > a/file.txt
> $ echo b > b/file.txt
> $ brz add a b
> adding a
> adding b
> adding b
> adding b
> ```
>
> I expected to see:
> ```
> $ brz add a b
> adding a
> adding b
> adding a/file.txt
> adding b/file.txt
> ```
>
> It looks like the culprit is `breezy/git/workingtree.py(504)smart_add()` where it should be using `call_action(subp, kind)`
> ```
> -> call_action(filepath, kind)
> (Pdb) l
> 499 if subpath in index:
> 500 # Already present
> 501 continue
> 502 if subp in conflicts_related:
> 503 continue
> 504 -> call_action(filepath, kind)
> 505 if save:
> 506 self._index_add_entry(subp, kind)
> 507 added.append(subp)
> 508 return added, ignored
> 509
> ```
Thanks for the report and suggested fix. Can you create a merge
proposal? With tests would be great, but without is fine too.

Cheers,

Jelmer

Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.0.0
Revision history for this message
Brian de Alwis (slyguy) wrote :

Sorry, I wasn't sure how to write a test for this.

Jelmer Vernooij (jelmer)
Changed in brz:
status: Triaged → Fix Committed
Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 1799482] Re: `brz add` in git format doesn't report files added

On Wed, Oct 24, 2018 at 01:21:21AM -0000, Brian de Alwis wrote:
> Sorry, I wasn't sure how to write a test for this.
No worries; proposed your fix with some additional tests in https://code.launchpad.net/~jelmer/brz/fix1799482/+merge/357734

Jelmer Vernooij (jelmer)
Changed in brz:
assignee: nobody → Brian de Alwis (slyguy)
Jelmer Vernooij (jelmer)
Changed in brz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.