Open Bug 2072698 Opened 2 months ago Updated 1 month ago

`moz-phab patch` raises `AttributeError: 'Namespace' object has no attribute 'upstream'` after fetching in a Jujutsu repository

Categories

(Conduit :: moz-phab, defect, P3)

Tracking

(Not tracked)

People

(Reporter: tgiles, Unassigned)

References

(Blocks 1 open bug)

Details

moz-phab patch crashes in a Jujutsu repository after fetching a missing base commit.

Steps to reproduce

The failure was observed with MozPhab 2.19.0, Python 3.12.10, Windows, and a Jujutsu Firefox repository.

  1. Choose a revision whose base commit is not available locally.
  2. Run moz-phab patch https://phabricator.services.mozilla.com/D325996

The following snippet reproduces the exception without a repository or network connection:

import argparse

from mozphab.git import Git
from mozphab.jujutsu import Jujutsu

repo = object.__new__(Jujutsu)
git_repo = object.__new__(Git)
git_repo.args = argparse.Namespace()
repo._Jujutsu__git_repo = git_repo

repo.set_args(argparse.Namespace(upstream=None))
repo.is_public("cafebabe")

Actual result

moz-phab runs jj git fetch. After the fetch succeeds, the command exits with:

AttributeError: 'Namespace' object has no attribute 'upstream'

The snippet raises the same exception from Git.get_base_remotes().

After a separate jj git fetch, rerunning the same moz-phab patch command succeeded.

Expected result

After fetching the missing base commit, moz-phab patch should continue applying the revision.

Blocks: moz-phab-jj
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.